public class ScriptBasedMapper extends AbstractSAMLProtocolMapper implements SAMLAttributeStatementMapper
Modifier and Type | Field and Description |
---|---|
static String |
PROVIDER_ID |
Constructor and Description |
---|
ScriptBasedMapper() |
Modifier and Type | Method and Description |
---|---|
static ProtocolMapperModel |
create(String name,
String samlAttributeName,
String nameFormat,
String friendlyName,
String script,
boolean singleAttribute)
Creates an protocol mapper model for the this script based mapper.
|
List<ProviderConfigProperty> |
getConfigProperties() |
String |
getDisplayCategory() |
String |
getDisplayType() |
String |
getHelpText() |
String |
getId() |
void |
transformAttributeStatement(AttributeStatementType attributeStatement,
ProtocolMapperModel mappingModel,
KeycloakSession session,
UserSessionModel userSession,
AuthenticatedClientSessionModel clientSession)
This method attaches one or many attributes to the passed attribute statement.
|
void |
validateConfig(KeycloakSession session,
RealmModel realm,
ProtocolMapperContainerModel client,
ProtocolMapperModel mapperModel)
Called when instance of mapperModel is created/updated for this protocolMapper through admin endpoint
|
close, create, getProtocol, init, postInit
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getPriority
order
public static final String PROVIDER_ID
public List<ProviderConfigProperty> getConfigProperties()
getConfigProperties
in interface ConfiguredProvider
public String getId()
getId
in interface ProviderFactory<ProtocolMapper>
public String getDisplayType()
getDisplayType
in interface ProtocolMapper
public String getDisplayCategory()
getDisplayCategory
in interface ProtocolMapper
public String getHelpText()
getHelpText
in interface ConfiguredProvider
public void transformAttributeStatement(AttributeStatementType attributeStatement, ProtocolMapperModel mappingModel, KeycloakSession session, UserSessionModel userSession, AuthenticatedClientSessionModel clientSession)
transformAttributeStatement
in interface SAMLAttributeStatementMapper
attributeStatement
- The attribute statements to be added to a tokenmappingModel
- The mapping model reflects the values that are actually input in the GUIsession
- The current sessionuserSession
- The current user sessionclientSession
- The current client sessionpublic void validateConfig(KeycloakSession session, RealmModel realm, ProtocolMapperContainerModel client, ProtocolMapperModel mapperModel) throws ProtocolMapperConfigException
ProtocolMapper
validateConfig
in interface ProtocolMapper
client
- client or clientTemplateProtocolMapperConfigException
- if configuration provided in mapperModel is not validpublic static ProtocolMapperModel create(String name, String samlAttributeName, String nameFormat, String friendlyName, String script, boolean singleAttribute)
name
- The name of the mapper (this has no functional use)samlAttributeName
- The name of the attribute in the SAML attributenameFormat
- can be "basic", "URI reference" or "unspecified"friendlyName
- a display name, only useful for the keycloak GUIscript
- the javascript to be executed by the mappersingleAttribute
- If true, all groups will be stored under one attribute with multiple attribute valuesCopyright © 2021 JBoss by Red Hat. All rights reserved.