org.keycloak.services.resources

## Class IdentityBrokerService

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

- All Implemented Interfaces:
    IdentityProvider.AuthenticationCallback

      public class IdentityBrokerService
      extends Object
      implements IdentityProvider.AuthenticationCallback

  Author:
    Pedro Igor

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `BROKER_PROVIDER_ID`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `IdentityBrokerService(RealmModel realmModel)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `javax.ws.rs.core.Response` | `authenticated(Map<String,String> userNotes, IdentityProviderModel identityProviderConfig, FederatedIdentity federatedIdentity, String code)` This method should be called by provider after the JAXRS callback endpoint has finished authentication with the remote IDP
    `javax.ws.rs.core.Response` | `consentTokenRetrieval(String providerId, javax.ws.rs.core.MultivaluedMap<String,String> formData)`
    `Object` | `getEndpoint(String providerId)`
    `static IdentityProvider` | `getIdentityProvider(KeycloakSession session, RealmModel realm, String alias)`
    `void` | `init()`
    `javax.ws.rs.core.Response` | `performLogin(String providerId, String code)`
    `javax.ws.rs.core.Response` | `retrieveToken(String providerId)`
    `javax.ws.rs.core.Response` | `retrieveTokenPreflight()`

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

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

- - ### Field Detail

    - #### BROKER_PROVIDER_ID

          public static final String BROKER_PROVIDER_ID

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### IdentityBrokerService

          public IdentityBrokerService(RealmModel realmModel)

  - ### Method Detail

    - #### init

          public void init()

    - #### performLogin

          @GET
          @Path(value="/{provider_id}/login")
          public javax.ws.rs.core.Response performLogin(@PathParam(value="provider_id")
                                                        String providerId,
                                                        @QueryParam(value="code")
                                                        String code)

    - #### getEndpoint

          @Path(value="{provider_id}/endpoint")
          public Object getEndpoint(@PathParam(value="provider_id")
                                String providerId)

    - #### retrieveTokenPreflight

          @Path(value="{provider_id}/token")
          @OPTIONS
          public javax.ws.rs.core.Response retrieveTokenPreflight()

    - #### retrieveToken

          @GET
          @Path(value="{provider_id}/token")
          public javax.ws.rs.core.Response retrieveToken(@PathParam(value="provider_id")
                                                         String providerId)

    - #### consentTokenRetrieval

          @POST
          @Path(value="{provider_id}/token")
          @Consumes(value="application/x-www-form-urlencoded")
          public javax.ws.rs.core.Response consentTokenRetrieval(@PathParam(value="provider_id")
                                                                           String providerId,
                                                                           javax.ws.rs.core.MultivaluedMap<String,String> formData)

    - #### authenticated

          public javax.ws.rs.core.Response authenticated(Map<String,String> userNotes,
                                                IdentityProviderModel identityProviderConfig,
                                                FederatedIdentity federatedIdentity,
                                                String code)

      Description copied from interface: `IdentityProvider.AuthenticationCallback`
      This method should be called by provider after the JAXRS callback endpoint has finished authentication with the remote IDP
      Specified by:
        `authenticated` in interface `IdentityProvider.AuthenticationCallback`
      Parameters:
        `userNotes` - notes to add to the UserSessionModel
        `identityProviderConfig` - provider config
        `federatedIdentity` - federated identity
        `code` - relayState or state parameter used to identity the client session
      Returns:

    - #### getIdentityProvider

          public static IdentityProvider getIdentityProvider(KeycloakSession session,
                                             RealmModel realm,
                                             String alias)

Copyright © 2015. All rights reserved.