org.keycloak.services.resources

## Class RealmsResource

- java.lang.Object
- - org.keycloak.services.resources.RealmsResource

-     @Path(value="/realms")
      public class RealmsResource
      extends Object

  Version:
    $Revision: 1 $
  Author:
    Bill Burke

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected ClientConnection` | `clientConnection`
    `protected static org.jboss.logging.Logger` | `logger`
    `protected KeycloakSession` | `session`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `RealmsResource()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static javax.ws.rs.core.UriBuilder` | `accountUrl(javax.ws.rs.core.UriBuilder base)`
    `static javax.ws.rs.core.UriBuilder` | `brokerUrl(javax.ws.rs.core.UriInfo uriInfo)`
    `static javax.ws.rs.core.UriBuilder` | `clientRegistrationUrl(javax.ws.rs.core.UriInfo uriInfo)`
    `Object` | `getAccountService(String name)`
    `Object` | `getAuthorizationService(String name)`
    `IdentityBrokerService` | `getBrokerService(String name)`
    `ClientsManagementService` | `getClientsManagementService(String name)`
    `ClientRegistrationService` | `getClientsService(String name)`
    `LoginActionsService` | `getLoginActionsService(String name)`
    `Object` | `getProtocol(String name, String protocol)`
    `PublicRealmResource` | `getRealmResource(String name)`
    `javax.ws.rs.core.Response` | `getRedirect(String realmName, String clientId)` Returns a temporary redirect to the client url configured for the given `clientId` in the given `realmName`.
    `javax.ws.rs.core.Response` | `getVersionPreflight(String name, String providerName)`
    `javax.ws.rs.core.Response` | `getWellKnown(String name, String providerName)`
    `static javax.ws.rs.core.UriBuilder` | `protocolUrl(javax.ws.rs.core.UriBuilder builder)`
    `static javax.ws.rs.core.UriBuilder` | `protocolUrl(javax.ws.rs.core.UriInfo uriInfo)`
    `static javax.ws.rs.core.UriBuilder` | `realmBaseUrl(javax.ws.rs.core.UriBuilder baseUriBuilder)`
    `static javax.ws.rs.core.UriBuilder` | `realmBaseUrl(javax.ws.rs.core.UriInfo uriInfo)`
    `Object` | `resolveRealmExtension(String realmName, String extension)` A JAX-RS sub-resource locator that uses the `RealmResourceSPI` to resolve sub-resources instances given an `unknownPath`.
    `static javax.ws.rs.core.UriBuilder` | `wellKnownProviderUrl(javax.ws.rs.core.UriBuilder builder)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### logger

          protected static final org.jboss.logging.Logger logger

    - #### session

          @Context
          protected KeycloakSession session

    - #### clientConnection

          @Context
          protected ClientConnection clientConnection

  - ### Constructor Detail

    - #### RealmsResource

          public RealmsResource()

  - ### Method Detail

    - #### realmBaseUrl

          public static javax.ws.rs.core.UriBuilder realmBaseUrl(javax.ws.rs.core.UriInfo uriInfo)

    - #### realmBaseUrl

          public static javax.ws.rs.core.UriBuilder realmBaseUrl(javax.ws.rs.core.UriBuilder baseUriBuilder)

    - #### accountUrl

          public static javax.ws.rs.core.UriBuilder accountUrl(javax.ws.rs.core.UriBuilder base)

    - #### protocolUrl

          public static javax.ws.rs.core.UriBuilder protocolUrl(javax.ws.rs.core.UriInfo uriInfo)

    - #### protocolUrl

          public static javax.ws.rs.core.UriBuilder protocolUrl(javax.ws.rs.core.UriBuilder builder)

    - #### clientRegistrationUrl

          public static javax.ws.rs.core.UriBuilder clientRegistrationUrl(javax.ws.rs.core.UriInfo uriInfo)

    - #### brokerUrl

          public static javax.ws.rs.core.UriBuilder brokerUrl(javax.ws.rs.core.UriInfo uriInfo)

    - #### wellKnownProviderUrl

          public static javax.ws.rs.core.UriBuilder wellKnownProviderUrl(javax.ws.rs.core.UriBuilder builder)

    - #### getProtocol

          @Path(value="{realm}/protocol/{protocol}")
          public Object getProtocol(@PathParam(value="realm")
                                                                               String name,
                                                                               @PathParam(value="protocol")
                                                                               String protocol)

    - #### getRedirect

          @GET
           @Path(value="{realm}/clients/{client_id}/redirect")
          public javax.ws.rs.core.Response getRedirect(@PathParam(value="realm")
                                                                                                                 String realmName,
                                                                                                                 @PathParam(value="client_id")
                                                                                                                 String clientId)

      Returns a temporary redirect to the client url configured for the given `clientId` in the given `realmName`.

      This allows a client to refer to other clients just by their client id in URLs, will then redirect users to the actual client url. The client url is derived according to the rules of the base url in the client configuration.

      Parameters:
        `realmName` -
        `clientId` -
      Returns:
      Since:
        2.0

    - #### getLoginActionsService

          @Path(value="{realm}/login-actions")
          public LoginActionsService getLoginActionsService(@PathParam(value="realm")
                                                                                                 String name)

    - #### getClientsService

          @Path(value="{realm}/clients-registrations")
          public ClientRegistrationService getClientsService(@PathParam(value="realm")
                                                                                                          String name)

    - #### getClientsManagementService

          @Path(value="{realm}/clients-managements")
          public ClientsManagementService getClientsManagementService(@PathParam(value="realm")
                                                                                                                 String name)

    - #### getAccountService

          @Path(value="{realm}/account")
          public Object getAccountService(@PathParam(value="realm")
                                                                         String name)

    - #### getRealmResource

          @Path(value="{realm}")
          public PublicRealmResource getRealmResource(@PathParam(value="realm")
                                                                             String name)

    - #### getBrokerService

          @Path(value="{realm}/broker")
          public IdentityBrokerService getBrokerService(@PathParam(value="realm")
                                                                                      String name)

    - #### getVersionPreflight

          @OPTIONS
           @Path(value="{realm}/.well-known/{provider}")
           @Produces(value="application/json")
          public javax.ws.rs.core.Response getVersionPreflight(@PathParam(value="realm")
                                                                                                                                                            String name,
                                                                                                                                                            @PathParam(value="provider")
                                                                                                                                                            String providerName)

    - #### getWellKnown

          @GET
           @Path(value="{realm}/.well-known/{provider}")
           @Produces(value="application/json")
          public javax.ws.rs.core.Response getWellKnown(@PathParam(value="realm")
                                                                                                                                                 String name,
                                                                                                                                                 @PathParam(value="provider")
                                                                                                                                                 String providerName)

    - #### getAuthorizationService

          @Path(value="{realm}/authz")
          public Object getAuthorizationService(@PathParam(value="realm")
                                                                             String name)

    - #### resolveRealmExtension

          @Path(value="{realm}/{extension}")
          public Object resolveRealmExtension(@PathParam(value="realm")
                                                                                 String realmName,
                                                                                 @PathParam(value="extension")
                                                                                 String extension)

      A JAX-RS sub-resource locator that uses the `RealmResourceSPI` to resolve sub-resources instances given an `unknownPath`.
      Parameters:
        `extension` - a path that could be to a REST extension
      Returns:
        a JAX-RS sub-resource instance for the REST extension if found. Otherwise null is returned.

Copyright © 2020 JBoss by Red Hat. All rights reserved.