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
  • Constructor Details

    • IdentityBrokerService

      public IdentityBrokerService(KeycloakSession session)
  • Method Details

    • init

      public void init()
    • clientIntiatedAccountLinkingPreflight

      @OPTIONS @Path("/{provider_alias}/link") public jakarta.ws.rs.core.Response clientIntiatedAccountLinkingPreflight(@PathParam("provider_alias") String providerAlias)
      Closes off CORS preflight requests for account linking
      Parameters:
      providerAlias -
      Returns:
    • clientInitiatedAccountLinking

      @GET @Path("/{provider_alias}/link") public jakarta.ws.rs.core.Response clientInitiatedAccountLinking(@PathParam("provider_alias") String providerAlias, @QueryParam("redirect_uri") String redirectUri, @QueryParam("client_id") String clientId, @QueryParam("nonce") String nonce, @QueryParam("hash") String hash)
    • performPostLogin

      @POST @Path("/{provider_alias}/login") public jakarta.ws.rs.core.Response performPostLogin(@PathParam("provider_alias") String providerAlias, @QueryParam("session_code") String code, @QueryParam("client_id") String clientId, @QueryParam("tab_id") String tabId, @QueryParam("login_hint") String loginHint)
    • performLogin

      @GET @Path("/{provider_alias}/login") public jakarta.ws.rs.core.Response performLogin(@PathParam("provider_alias") String providerAlias, @QueryParam("session_code") String code, @QueryParam("client_id") String clientId, @QueryParam("tab_id") String tabId, @QueryParam("login_hint") String loginHint)
    • getEndpoint

      @Path("{provider_alias}/endpoint") public Object getEndpoint(@PathParam("provider_alias") String providerAlias)
    • retrieveTokenPreflight

      @Path("{provider_alias}/token") @OPTIONS public jakarta.ws.rs.core.Response retrieveTokenPreflight()
    • retrieveToken

      @GET @Path("{provider_alias}/token") public jakarta.ws.rs.core.Response retrieveToken(@PathParam("provider_alias") String providerAlias)
    • authenticated

      public jakarta.ws.rs.core.Response authenticated(BrokeredIdentityContext context)
      Specified by:
      authenticated in interface IdentityProvider.AuthenticationCallback
    • validateUser

      public jakarta.ws.rs.core.Response validateUser(AuthenticationSessionModel authSession, UserModel user, RealmModel realm)
    • afterFirstBrokerLogin

      @GET @Path("/after-first-broker-login") public jakarta.ws.rs.core.Response afterFirstBrokerLogin(@QueryParam("session_code") String code, @QueryParam("client_id") String clientId, @QueryParam("tab_id") String tabId)
    • afterPostBrokerLoginFlow

      @GET @Path("/after-post-broker-login") public jakarta.ws.rs.core.Response afterPostBrokerLoginFlow(@QueryParam("session_code") String code, @QueryParam("client_id") String clientId, @QueryParam("tab_id") String tabId)
    • cancelled

      public jakarta.ws.rs.core.Response cancelled(IdentityProviderModel idpConfig)
      Specified by:
      cancelled in interface IdentityProvider.AuthenticationCallback
    • error

      public jakarta.ws.rs.core.Response error(String message)
      Specified by:
      error in interface IdentityProvider.AuthenticationCallback
    • getAndVerifyAuthenticationSession

      public AuthenticationSessionModel getAndVerifyAuthenticationSession(String encodedCode)
      Specified by:
      getAndVerifyAuthenticationSession in interface IdentityProvider.AuthenticationCallback
    • browserAuthentication

      protected jakarta.ws.rs.core.Response browserAuthentication(AuthenticationSessionModel authSession, String errorMessage, Object... parameters)
    • getIdentityProvider

      public static IdentityProvider<?> getIdentityProvider(KeycloakSession session, RealmModel realm, String alias)
    • getIdentityProviderFactory

      public static IdentityProviderFactory<?> getIdentityProviderFactory(KeycloakSession session, IdentityProviderModel model)