public class UserRealmRoleMappingMapper extends AbstractOIDCProtocolMapper
| Modifier and Type | Field and Description |
|---|---|
static String |
PROVIDER_ID |
TOKEN_MAPPER_CATEGORY| Constructor and Description |
|---|
UserRealmRoleMappingMapper() |
| Modifier and Type | Method and Description |
|---|---|
static ProtocolMapperModel |
create(String realmRolePrefix,
String name,
String tokenClaimName,
boolean accessToken,
boolean idToken) |
static ProtocolMapperModel |
create(String realmRolePrefix,
String name,
String tokenClaimName,
boolean accessToken,
boolean idToken,
boolean multiValued) |
static Stream<RoleModel> |
getAllUserRolesStream(UserModel user)
Returns a stream with roles that come from:
Direct assignment of the role to the user
Direct assignment of the role to any group of the user or any of its parent group
Composite roles are expanded recursively, the composite role itself is also contained in the returned stream
|
List<ProviderConfigProperty> |
getConfigProperties() |
String |
getDisplayCategory() |
String |
getDisplayType() |
String |
getHelpText() |
String |
getId() |
protected void |
setClaim(IDToken token,
ProtocolMapperModel mappingModel,
UserSessionModel userSession)
Intended to be overridden in
ProtocolMapper implementations to add claims to an token. |
protected static void |
setClaim(IDToken token,
ProtocolMapperModel mappingModel,
UserSessionModel userSession,
Predicate<RoleModel> restriction,
String prefix)
Retrieves all roles of the current user based on direct roles set to the user, its groups and their parent groups.
|
close, create, getProtocol, init, postInit, setClaim, transformAccessToken, transformIDToken, transformUserInfoTokenclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waittransformAccessTokentransformIDTokentransformUserInfoTokenvalidateConfigorderpublic static final String PROVIDER_ID
public List<ProviderConfigProperty> getConfigProperties()
public String getId()
public String getDisplayType()
public String getDisplayCategory()
public String getHelpText()
protected void setClaim(IDToken token, ProtocolMapperModel mappingModel, UserSessionModel userSession)
AbstractOIDCProtocolMapperProtocolMapper implementations to add claims to an token.setClaim in class AbstractOIDCProtocolMapperpublic static ProtocolMapperModel create(String realmRolePrefix, String name, String tokenClaimName, boolean accessToken, boolean idToken)
public static ProtocolMapperModel create(String realmRolePrefix, String name, String tokenClaimName, boolean accessToken, boolean idToken, boolean multiValued)
public static Stream<RoleModel> getAllUserRolesStream(UserModel user)
user - User to enumerate the roles forprotected static void setClaim(IDToken token, ProtocolMapperModel mappingModel, UserSessionModel userSession, Predicate<RoleModel> restriction, String prefix)
restriction.
If the current client sessions is restricted (i.e. no client found in active user session has full scope allowed),
the final list of roles is also restricted by the client scope. Finally, the list is mapped to the token into
a claim.token - mappingModel - userSession - restriction - prefix - Copyright © 2018 JBoss by Red Hat. All rights reserved.