Package 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
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionjakarta.ws.rs.core.ResponseafterFirstBrokerLogin(String code, String clientId, String tabId) jakarta.ws.rs.core.ResponseafterPostBrokerLoginFlow(String code, String clientId, String tabId) jakarta.ws.rs.core.Responseauthenticated(BrokeredIdentityContext context) This method should be called by provider after the JAXRS callback endpoint has finished authentication with the remote IDP.protected jakarta.ws.rs.core.ResponsebrowserAuthentication(AuthenticationSessionModel authSession, String errorMessage, Object... parameters) jakarta.ws.rs.core.Responsecancelled(IdentityProviderModel idpConfig) Called when user cancelled authentication on the IDP side - for example user didn't approve consent page on the IDP side.jakarta.ws.rs.core.ResponseclientInitiatedAccountLinking(String providerId, String redirectUri, String clientId, String nonce, String hash) jakarta.ws.rs.core.ResponseclientIntiatedAccountLinkingPreflight(String providerId) Closes off CORS preflight requests for account linkingjakarta.ws.rs.core.ResponseCalled when error happened on the IDP side.getAndVerifyAuthenticationSession(String encodedCode) Common method to return current authenticationSession and verify if it is not expiredgetEndpoint(String providerId) static IdentityProvidergetIdentityProvider(KeycloakSession session, RealmModel realm, String alias) static IdentityProviderFactorygetIdentityProviderFactory(KeycloakSession session, IdentityProviderModel model) voidinit()jakarta.ws.rs.core.Responsejakarta.ws.rs.core.Responsejakarta.ws.rs.core.ResponseretrieveToken(String providerId) jakarta.ws.rs.core.Responsejakarta.ws.rs.core.ResponsevalidateUser(AuthenticationSessionModel authSession, UserModel user, RealmModel realm)
-
Constructor Details
-
IdentityBrokerService
-
-
Method Details
-
init
public void init() -
clientIntiatedAccountLinkingPreflight
@OPTIONS @Path("/{provider_id}/link") public jakarta.ws.rs.core.Response clientIntiatedAccountLinkingPreflight(@PathParam("provider_id") String providerId) Closes off CORS preflight requests for account linking- Parameters:
providerId-- Returns:
-
clientInitiatedAccountLinking
@GET @Path("/{provider_id}/link") public jakarta.ws.rs.core.Response clientInitiatedAccountLinking(@PathParam("provider_id") String providerId, @QueryParam("redirect_uri") String redirectUri, @QueryParam("client_id") String clientId, @QueryParam("nonce") String nonce, @QueryParam("hash") String hash) -
performPostLogin
-
performLogin
-
getEndpoint
-
retrieveTokenPreflight
@Path("{provider_id}/token") @OPTIONS public jakarta.ws.rs.core.Response retrieveTokenPreflight() -
retrieveToken
@GET @Path("{provider_id}/token") public jakarta.ws.rs.core.Response retrieveToken(@PathParam("provider_id") String providerId) -
authenticated
Description copied from interface:IdentityProvider.AuthenticationCallbackThis method should be called by provider after the JAXRS callback endpoint has finished authentication with the remote IDP. There is an assumption that authenticationSession is set in the context when this method is called- Specified by:
authenticatedin interfaceIdentityProvider.AuthenticationCallback- Returns:
- see description
-
validateUser
public jakarta.ws.rs.core.Response validateUser(AuthenticationSessionModel authSession, UserModel user, RealmModel realm) -
afterFirstBrokerLogin
-
afterPostBrokerLoginFlow
-
cancelled
Description copied from interface:IdentityProvider.AuthenticationCallbackCalled when user cancelled authentication on the IDP side - for example user didn't approve consent page on the IDP side. Assumption is that authenticationSession is set in theKeycloakContextwhen this method is called- Specified by:
cancelledin interfaceIdentityProvider.AuthenticationCallback- Parameters:
idpConfig- identity provider config- Returns:
- see description
-
error
Description copied from interface:IdentityProvider.AuthenticationCallbackCalled when error happened on the IDP side. Assumption is that authenticationSession is set in theKeycloakContextwhen this method is called- Specified by:
errorin interfaceIdentityProvider.AuthenticationCallback- Returns:
- see description
-
getAndVerifyAuthenticationSession
Description copied from interface:IdentityProvider.AuthenticationCallbackCommon method to return current authenticationSession and verify if it is not expired- Specified by:
getAndVerifyAuthenticationSessionin interfaceIdentityProvider.AuthenticationCallback- Returns:
- see description
-
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)
-