Class RoleNameMapper
java.lang.Object
org.keycloak.protocol.oidc.mappers.AbstractOIDCProtocolMapper
org.keycloak.protocol.oidc.mappers.RoleNameMapper
- All Implemented Interfaces:
OIDCAccessTokenMapper
,TokenIntrospectionTokenMapper
,UserInfoTokenMapper
,ProtocolMapper
,ConfiguredProvider
,Provider
,ProviderFactory<ProtocolMapper>
public class RoleNameMapper
extends AbstractOIDCProtocolMapper
implements OIDCAccessTokenMapper, UserInfoTokenMapper, TokenIntrospectionTokenMapper
Map an assigned role to a different position and name in the token
- Version:
- $Revision: 1 $
- Author:
- Bill Burke
-
Field Summary
Fields inherited from class org.keycloak.protocol.oidc.mappers.AbstractOIDCProtocolMapper
TOKEN_MAPPER_CATEGORY
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic ProtocolMapperModel
getId()
int
Priority of this protocolMapper implementation.protected void
setClaim
(IDToken token, ProtocolMapperModel mappingModel, UserSessionModel userSession, KeycloakSession session, ClientSessionContext clientSessionCtx) Intended to be overridden inProtocolMapper
implementations to add claims to an token.transformAccessToken
(AccessToken token, ProtocolMapperModel mappingModel, KeycloakSession session, UserSessionModel userSession, ClientSessionContext clientSessionCtx) transformIntrospectionToken
(AccessToken token, ProtocolMapperModel mappingModel, KeycloakSession session, UserSessionModel userSession, ClientSessionContext clientSessionCtx) transformUserInfoToken
(AccessToken token, ProtocolMapperModel mappingModel, KeycloakSession session, UserSessionModel userSession, ClientSessionContext clientSessionCtx) Methods inherited from class org.keycloak.protocol.oidc.mappers.AbstractOIDCProtocolMapper
close, create, getEffectiveModel, getProtocol, init, postInit, setClaim, setClaim, transformAccessTokenResponse, transformIDToken
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.keycloak.provider.ConfiguredProvider
getConfig
Methods inherited from interface org.keycloak.protocol.ProtocolMapper
validateConfig
Methods inherited from interface org.keycloak.provider.ProviderFactory
getConfigMetadata, order
-
Field Details
-
ROLE_CONFIG
- See Also:
-
NEW_ROLE_NAME
-
PROVIDER_ID
- See Also:
-
-
Constructor Details
-
RoleNameMapper
public RoleNameMapper()
-
-
Method Details
-
getConfigProperties
- Specified by:
getConfigProperties
in interfaceConfiguredProvider
-
getId
- Specified by:
getId
in interfaceProviderFactory<ProtocolMapper>
-
getDisplayType
- Specified by:
getDisplayType
in interfaceProtocolMapper
-
getDisplayCategory
- Specified by:
getDisplayCategory
in interfaceProtocolMapper
-
getHelpText
- Specified by:
getHelpText
in interfaceConfiguredProvider
-
getPriority
public int getPriority()Description copied from interface:ProtocolMapper
Priority of this protocolMapper implementation. Lower goes first.- Specified by:
getPriority
in interfaceProtocolMapper
- Returns:
-
transformUserInfoToken
public AccessToken transformUserInfoToken(AccessToken token, ProtocolMapperModel mappingModel, KeycloakSession session, UserSessionModel userSession, ClientSessionContext clientSessionCtx) - Specified by:
transformUserInfoToken
in interfaceUserInfoTokenMapper
- Overrides:
transformUserInfoToken
in classAbstractOIDCProtocolMapper
-
transformAccessToken
public AccessToken transformAccessToken(AccessToken token, ProtocolMapperModel mappingModel, KeycloakSession session, UserSessionModel userSession, ClientSessionContext clientSessionCtx) - Specified by:
transformAccessToken
in interfaceOIDCAccessTokenMapper
- Overrides:
transformAccessToken
in classAbstractOIDCProtocolMapper
-
transformIntrospectionToken
public AccessToken transformIntrospectionToken(AccessToken token, ProtocolMapperModel mappingModel, KeycloakSession session, UserSessionModel userSession, ClientSessionContext clientSessionCtx) - Specified by:
transformIntrospectionToken
in interfaceTokenIntrospectionTokenMapper
- Overrides:
transformIntrospectionToken
in classAbstractOIDCProtocolMapper
-
setClaim
protected void setClaim(IDToken token, ProtocolMapperModel mappingModel, UserSessionModel userSession, KeycloakSession session, ClientSessionContext clientSessionCtx) Description copied from class:AbstractOIDCProtocolMapper
Intended to be overridden inProtocolMapper
implementations to add claims to an token.- Overrides:
setClaim
in classAbstractOIDCProtocolMapper
-
create
-