public class ScriptBasedOIDCProtocolMapper extends AbstractOIDCProtocolMapper implements OIDCAccessTokenMapper, OIDCIDTokenMapper, UserInfoTokenMapper, OIDCAccessTokenResponseMapper, EnvironmentDependentProviderFactory
ProtocolMapper
that uses a provided JavaScript fragment to compute the token claim value.Modifier and Type | Field and Description |
---|---|
static String |
PROVIDER_ID |
static String |
SCRIPT |
TOKEN_MAPPER_CATEGORY
Constructor and Description |
---|
ScriptBasedOIDCProtocolMapper() |
Modifier and Type | Method and Description |
---|---|
static ProtocolMapperModel |
create(String name,
String userAttribute,
String tokenClaimName,
String claimType,
boolean accessToken,
boolean idToken,
String script,
boolean multiValued) |
List<ProviderConfigProperty> |
getConfigProperties() |
String |
getDisplayCategory() |
String |
getDisplayType() |
String |
getHelpText() |
String |
getId() |
int |
getPriority() |
protected String |
getScriptCode(ProtocolMapperModel mapperModel) |
boolean |
isSupported() |
protected void |
setClaim(AccessTokenResponse accessTokenResponse,
ProtocolMapperModel mappingModel,
UserSessionModel userSession,
KeycloakSession keycloakSession,
ClientSessionContext clientSessionCtx)
Intended to be overridden in
ProtocolMapper implementations to add claims to an token. |
protected void |
setClaim(IDToken token,
ProtocolMapperModel mappingModel,
UserSessionModel userSession,
KeycloakSession keycloakSession,
ClientSessionContext clientSessionCtx)
Intended to be overridden in
ProtocolMapper implementations to add claims to an token. |
void |
validateConfig(KeycloakSession session,
RealmModel realm,
ProtocolMapperContainerModel client,
ProtocolMapperModel mapperModel) |
close, create, getProtocol, init, postInit, setClaim, transformAccessToken, transformAccessTokenResponse, transformIDToken, transformUserInfoToken
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
transformAccessToken
transformIDToken
transformUserInfoToken
transformAccessTokenResponse
order
public static final String PROVIDER_ID
public static final String SCRIPT
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 boolean isSupported()
isSupported
in interface EnvironmentDependentProviderFactory
public int getPriority()
getPriority
in interface ProtocolMapper
protected void setClaim(IDToken token, ProtocolMapperModel mappingModel, UserSessionModel userSession, KeycloakSession keycloakSession, ClientSessionContext clientSessionCtx)
AbstractOIDCProtocolMapper
ProtocolMapper
implementations to add claims to an token.setClaim
in class AbstractOIDCProtocolMapper
protected void setClaim(AccessTokenResponse accessTokenResponse, ProtocolMapperModel mappingModel, UserSessionModel userSession, KeycloakSession keycloakSession, ClientSessionContext clientSessionCtx)
AbstractOIDCProtocolMapper
ProtocolMapper
implementations to add claims to an token.setClaim
in class AbstractOIDCProtocolMapper
public void validateConfig(KeycloakSession session, RealmModel realm, ProtocolMapperContainerModel client, ProtocolMapperModel mapperModel) throws ProtocolMapperConfigException
validateConfig
in interface ProtocolMapper
ProtocolMapperConfigException
protected String getScriptCode(ProtocolMapperModel mapperModel)
Copyright © 2021 JBoss by Red Hat. All rights reserved.