Class RoleNameMapper
- java.lang.Object
-
- org.keycloak.protocol.saml.mappers.RoleNameMapper
-
- All Implemented Interfaces:
ProtocolMapper
,SAMLRoleNameMapper
,ConfiguredProvider
,Provider
,ProviderFactory<ProtocolMapper>
public class RoleNameMapper extends Object implements SAMLRoleNameMapper, ProtocolMapper
Map an assigned role to a different position and name in the token- Version:
- $Revision: 1 $
- Author:
- Bill Burke
-
-
Field Summary
Fields Modifier and Type Field Description static String
NEW_ROLE_NAME
static String
PROVIDER_ID
static String
ROLE_CONFIG
-
Constructor Summary
Constructors Constructor Description RoleNameMapper()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
This is called when the server shuts down.static ProtocolMapperModel
create(String name, String role, String newName)
ProtocolMapper
create(KeycloakSession session)
List<ProviderConfigProperty>
getConfigProperties()
String
getDisplayCategory()
String
getDisplayType()
String
getHelpText()
String
getId()
String
getProtocol()
void
init(Config.Scope config)
Only called once when the factory is first created.String
mapName(ProtocolMapperModel model, RoleModel roleModel)
void
postInit(KeycloakSessionFactory factory)
Called after all provider factories have been initialized-
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
getPriority, validateConfig
-
Methods inherited from interface org.keycloak.provider.ProviderFactory
getConfigMetadata, order
-
-
-
-
Field Detail
-
ROLE_CONFIG
public static final String ROLE_CONFIG
- See Also:
- Constant Field Values
-
NEW_ROLE_NAME
public static String NEW_ROLE_NAME
-
PROVIDER_ID
public static final String PROVIDER_ID
- See Also:
- Constant Field Values
-
-
Method Detail
-
getConfigProperties
public List<ProviderConfigProperty> getConfigProperties()
- Specified by:
getConfigProperties
in interfaceConfiguredProvider
-
getId
public String getId()
- Specified by:
getId
in interfaceProviderFactory<ProtocolMapper>
-
getDisplayType
public String getDisplayType()
- Specified by:
getDisplayType
in interfaceProtocolMapper
-
getDisplayCategory
public String getDisplayCategory()
- Specified by:
getDisplayCategory
in interfaceProtocolMapper
-
getHelpText
public String getHelpText()
- Specified by:
getHelpText
in interfaceConfiguredProvider
-
mapName
public String mapName(ProtocolMapperModel model, RoleModel roleModel)
- Specified by:
mapName
in interfaceSAMLRoleNameMapper
-
create
public static ProtocolMapperModel create(String name, String role, String newName)
-
getProtocol
public String getProtocol()
- Specified by:
getProtocol
in interfaceProtocolMapper
-
close
public void close()
Description copied from interface:ProviderFactory
This is called when the server shuts down.- Specified by:
close
in interfaceProvider
- Specified by:
close
in interfaceProviderFactory<ProtocolMapper>
-
init
public void init(Config.Scope config)
Description copied from interface:ProviderFactory
Only called once when the factory is first created. This config is pulled from keycloak_server.json- Specified by:
init
in interfaceProviderFactory<ProtocolMapper>
-
create
public final ProtocolMapper create(KeycloakSession session)
- Specified by:
create
in interfaceProviderFactory<ProtocolMapper>
-
postInit
public void postInit(KeycloakSessionFactory factory)
Description copied from interface:ProviderFactory
Called after all provider factories have been initialized- Specified by:
postInit
in interfaceProviderFactory<ProtocolMapper>
-
-