public abstract class AbstractOAuth2IdentityProvider<C extends OAuth2IdentityProviderConfig> extends AbstractIdentityProvider<C> implements TokenExchangeTo
| Modifier and Type | Class and Description |
|---|---|
protected class |
AbstractOAuth2IdentityProvider.Endpoint |
IdentityProvider.AuthenticationCallback| Modifier and Type | Field and Description |
|---|---|
static String |
ACCESS_DENIED |
static String |
FEDERATED_ACCESS_TOKEN |
static String |
FEDERATED_REFRESH_TOKEN |
static String |
FEDERATED_TOKEN_EXPIRATION |
protected static org.jboss.logging.Logger |
logger |
protected static com.fasterxml.jackson.databind.ObjectMapper |
mapper |
static String |
OAUTH2_GRANT_TYPE_AUTHORIZATION_CODE |
static String |
OAUTH2_GRANT_TYPE_REFRESH_TOKEN |
static String |
OAUTH2_PARAMETER_ACCESS_TOKEN |
static String |
OAUTH2_PARAMETER_CLIENT_ID |
static String |
OAUTH2_PARAMETER_CLIENT_SECRET |
static String |
OAUTH2_PARAMETER_CODE |
static String |
OAUTH2_PARAMETER_GRANT_TYPE |
static String |
OAUTH2_PARAMETER_REDIRECT_URI |
static String |
OAUTH2_PARAMETER_RESPONSE_TYPE |
static String |
OAUTH2_PARAMETER_SCOPE |
static String |
OAUTH2_PARAMETER_STATE |
ACCOUNT_LINK_URL, session| Constructor and Description |
|---|
AbstractOAuth2IdentityProvider(KeycloakSession session,
C config) |
| Modifier and Type | Method and Description |
|---|---|
com.fasterxml.jackson.databind.JsonNode |
asJsonNode(String json) |
void |
authenticationFinished(AuthenticationSessionModel authSession,
BrokeredIdentityContext context) |
Object |
callback(RealmModel realm,
IdentityProvider.AuthenticationCallback callback,
EventBuilder event) |
protected javax.ws.rs.core.UriBuilder |
createAuthorizationUrl(AuthenticationRequest request) |
protected BrokeredIdentityContext |
doGetFederatedIdentity(String accessToken) |
protected javax.ws.rs.core.Response |
exchangeSessionToken(javax.ws.rs.core.UriInfo uriInfo,
ClientModel authorizedClient,
UserSessionModel tokenUserSession,
UserModel tokenSubject,
AccessToken token) |
protected javax.ws.rs.core.Response |
exchangeStoredToken(javax.ws.rs.core.UriInfo uriInfo,
ClientModel authorizedClient,
UserSessionModel tokenUserSession,
UserModel tokenSubject,
AccessToken token) |
javax.ws.rs.core.Response |
exchangeTo(javax.ws.rs.core.UriInfo uriInfo,
ClientModel authorizedClient,
UserSessionModel tokenUserSession,
UserModel tokenSubject,
AccessToken token,
javax.ws.rs.core.MultivaluedMap<String,String> params) |
protected String |
extractTokenFromResponse(String response,
String tokenName) |
protected String |
getAccessTokenResponseParameter() |
C |
getConfig() |
protected abstract String |
getDefaultScopes() |
BrokeredIdentityContext |
getFederatedIdentity(String response) |
String |
getJsonProperty(com.fasterxml.jackson.databind.JsonNode jsonNode,
String name)
Get JSON property as text.
|
javax.ws.rs.core.Response |
performLogin(AuthenticationRequest request) |
javax.ws.rs.core.Response |
retrieveToken(KeycloakSession session,
FederatedIdentityModel identity) |
backchannelLogout, close, exchangeErrorResponse, exchangeNotLinked, exchangeNotSupported, exchangeTokenExpired, exchangeUnsupportedRequiredType, export, getLinkingUrl, getMarshaller, importNewUser, keycloakInitiatedBrowserLogout, preprocessFederatedIdentity, updateBrokeredUserprotected static final org.jboss.logging.Logger logger
public static final String OAUTH2_GRANT_TYPE_REFRESH_TOKEN
public static final String OAUTH2_GRANT_TYPE_AUTHORIZATION_CODE
public static final String FEDERATED_ACCESS_TOKEN
public static final String FEDERATED_REFRESH_TOKEN
public static final String FEDERATED_TOKEN_EXPIRATION
public static final String ACCESS_DENIED
protected static com.fasterxml.jackson.databind.ObjectMapper mapper
public static final String OAUTH2_PARAMETER_ACCESS_TOKEN
public static final String OAUTH2_PARAMETER_SCOPE
public static final String OAUTH2_PARAMETER_STATE
public static final String OAUTH2_PARAMETER_RESPONSE_TYPE
public static final String OAUTH2_PARAMETER_REDIRECT_URI
public static final String OAUTH2_PARAMETER_CODE
public static final String OAUTH2_PARAMETER_CLIENT_ID
public static final String OAUTH2_PARAMETER_CLIENT_SECRET
public static final String OAUTH2_PARAMETER_GRANT_TYPE
public AbstractOAuth2IdentityProvider(KeycloakSession session, C config)
public Object callback(RealmModel realm, IdentityProvider.AuthenticationCallback callback, EventBuilder event)
callback in interface IdentityProvider<C extends OAuth2IdentityProviderConfig>callback in class AbstractIdentityProvider<C extends OAuth2IdentityProviderConfig>public javax.ws.rs.core.Response performLogin(AuthenticationRequest request)
performLogin in interface IdentityProvider<C extends OAuth2IdentityProviderConfig>performLogin in class AbstractIdentityProvider<C extends OAuth2IdentityProviderConfig>public javax.ws.rs.core.Response retrieveToken(KeycloakSession session, FederatedIdentityModel identity)
retrieveToken in interface IdentityProvider<C extends OAuth2IdentityProviderConfig>public C getConfig()
getConfig in class AbstractIdentityProvider<C extends OAuth2IdentityProviderConfig>protected String extractTokenFromResponse(String response, String tokenName)
public javax.ws.rs.core.Response exchangeTo(javax.ws.rs.core.UriInfo uriInfo,
ClientModel authorizedClient,
UserSessionModel tokenUserSession,
UserModel tokenSubject,
AccessToken token,
javax.ws.rs.core.MultivaluedMap<String,String> params)
exchangeTo in interface TokenExchangeToprotected javax.ws.rs.core.Response exchangeStoredToken(javax.ws.rs.core.UriInfo uriInfo,
ClientModel authorizedClient,
UserSessionModel tokenUserSession,
UserModel tokenSubject,
AccessToken token)
protected javax.ws.rs.core.Response exchangeSessionToken(javax.ws.rs.core.UriInfo uriInfo,
ClientModel authorizedClient,
UserSessionModel tokenUserSession,
UserModel tokenSubject,
AccessToken token)
public BrokeredIdentityContext getFederatedIdentity(String response)
protected String getAccessTokenResponseParameter()
protected BrokeredIdentityContext doGetFederatedIdentity(String accessToken)
protected javax.ws.rs.core.UriBuilder createAuthorizationUrl(AuthenticationRequest request)
public String getJsonProperty(com.fasterxml.jackson.databind.JsonNode jsonNode, String name)
jsonNode - to get property fromname - of property to getpublic com.fasterxml.jackson.databind.JsonNode asJsonNode(String json) throws IOException
IOExceptionprotected abstract String getDefaultScopes()
public void authenticationFinished(AuthenticationSessionModel authSession, BrokeredIdentityContext context)
authenticationFinished in interface IdentityProvider<C extends OAuth2IdentityProviderConfig>authenticationFinished in class AbstractIdentityProvider<C extends OAuth2IdentityProviderConfig>Copyright © 2017 JBoss by Red Hat. All rights reserved.