public class IdentityBrokerService extends Object implements IdentityProvider.AuthenticationCallback
Constructor and Description |
---|
IdentityBrokerService(RealmModel realmModel) |
Modifier and Type | Method and Description |
---|---|
javax.ws.rs.core.Response |
afterFirstBrokerLogin(String code,
String clientId,
String tabId) |
javax.ws.rs.core.Response |
afterPostBrokerLoginFlow(String code,
String clientId,
String tabId) |
javax.ws.rs.core.Response |
authenticated(BrokeredIdentityContext context)
This method should be called by provider after the JAXRS callback endpoint has finished authentication
with the remote IDP.
|
protected javax.ws.rs.core.Response |
browserAuthentication(AuthenticationSessionModel authSession,
String errorMessage) |
javax.ws.rs.core.Response |
cancelled()
Called when user cancelled authentication on the IDP side - for example user didn't approve consent page on the IDP side.
|
javax.ws.rs.core.Response |
clientInitiatedAccountLinking(String providerId,
String redirectUri,
String clientId,
String nonce,
String hash) |
javax.ws.rs.core.Response |
clientIntiatedAccountLinkingPreflight(String providerId)
Closes off CORS preflight requests for account linking
|
javax.ws.rs.core.Response |
error(String message)
Called when error happened on the IDP side.
|
AuthenticationSessionModel |
getAndVerifyAuthenticationSession(String encodedCode)
Common method to return current authenticationSession and verify if it is not expired
|
Object |
getEndpoint(String providerId) |
static IdentityProvider |
getIdentityProvider(KeycloakSession session,
RealmModel realm,
String alias) |
static IdentityProviderFactory |
getIdentityProviderFactory(KeycloakSession session,
IdentityProviderModel model) |
void |
init() |
javax.ws.rs.core.Response |
performLogin(String providerId,
String code,
String clientId,
String tabId,
String loginHint) |
javax.ws.rs.core.Response |
performPostLogin(String providerId,
String code,
String clientId,
String tabId,
String loginHint) |
javax.ws.rs.core.Response |
retrieveToken(String providerId) |
javax.ws.rs.core.Response |
retrieveTokenPreflight() |
javax.ws.rs.core.Response |
validateUser(AuthenticationSessionModel authSession,
UserModel user,
RealmModel realm) |
public IdentityBrokerService(RealmModel realmModel)
public void init()
@OPTIONS @Path(value="/{provider_id}/link") public javax.ws.rs.core.Response clientIntiatedAccountLinkingPreflight(@PathParam(value="provider_id") String providerId)
providerId
- @GET @Path(value="/{provider_id}/link") public javax.ws.rs.core.Response clientInitiatedAccountLinking(@PathParam(value="provider_id") String providerId, @QueryParam(value="redirect_uri") String redirectUri, @QueryParam(value="client_id") String clientId, @QueryParam(value="nonce") String nonce, @QueryParam(value="hash") String hash)
@POST @Path(value="/{provider_id}/login") public javax.ws.rs.core.Response performPostLogin(@PathParam(value="provider_id") String providerId, @QueryParam(value="session_code") String code, @QueryParam(value="client_id") String clientId, @QueryParam(value="tab_id") String tabId, @QueryParam(value="login_hint") String loginHint)
@GET @Path(value="/{provider_id}/login") public javax.ws.rs.core.Response performLogin(@PathParam(value="provider_id") String providerId, @QueryParam(value="session_code") String code, @QueryParam(value="client_id") String clientId, @QueryParam(value="tab_id") String tabId, @QueryParam(value="login_hint") String loginHint)
@Path(value="{provider_id}/endpoint") public Object getEndpoint(@PathParam(value="provider_id") String providerId)
@Path(value="{provider_id}/token") @OPTIONS public javax.ws.rs.core.Response retrieveTokenPreflight()
@GET @Path(value="{provider_id}/token") public javax.ws.rs.core.Response retrieveToken(@PathParam(value="provider_id") String providerId)
public javax.ws.rs.core.Response authenticated(BrokeredIdentityContext context)
IdentityProvider.AuthenticationCallback
authenticated
in interface IdentityProvider.AuthenticationCallback
public javax.ws.rs.core.Response validateUser(AuthenticationSessionModel authSession, UserModel user, RealmModel realm)
@GET @Path(value="/after-first-broker-login") public javax.ws.rs.core.Response afterFirstBrokerLogin(@QueryParam(value="session_code") String code, @QueryParam(value="client_id") String clientId, @QueryParam(value="tab_id") String tabId)
@GET @Path(value="/after-post-broker-login") public javax.ws.rs.core.Response afterPostBrokerLoginFlow(@QueryParam(value="session_code") String code, @QueryParam(value="client_id") String clientId, @QueryParam(value="tab_id") String tabId)
public javax.ws.rs.core.Response cancelled()
IdentityProvider.AuthenticationCallback
KeycloakContext
when this method is calledcancelled
in interface IdentityProvider.AuthenticationCallback
public javax.ws.rs.core.Response error(String message)
IdentityProvider.AuthenticationCallback
KeycloakContext
when this method is callederror
in interface IdentityProvider.AuthenticationCallback
public AuthenticationSessionModel getAndVerifyAuthenticationSession(String encodedCode)
IdentityProvider.AuthenticationCallback
getAndVerifyAuthenticationSession
in interface IdentityProvider.AuthenticationCallback
protected javax.ws.rs.core.Response browserAuthentication(AuthenticationSessionModel authSession, String errorMessage)
public static IdentityProvider getIdentityProvider(KeycloakSession session, RealmModel realm, String alias)
public static IdentityProviderFactory getIdentityProviderFactory(KeycloakSession session, IdentityProviderModel model)
Copyright © 2021 JBoss by Red Hat. All rights reserved.