Class SHA256PairwiseSubMapper
- java.lang.Object
-
- org.keycloak.protocol.oidc.mappers.AbstractOIDCProtocolMapper
-
- org.keycloak.protocol.oidc.mappers.AbstractPairwiseSubMapper
-
- org.keycloak.protocol.oidc.mappers.SHA256PairwiseSubMapper
-
- All Implemented Interfaces:
OIDCAccessTokenMapper
,OIDCIDTokenMapper
,UserInfoTokenMapper
,ProtocolMapper
,ConfiguredProvider
,Provider
,ProviderFactory<ProtocolMapper>
public class SHA256PairwiseSubMapper extends AbstractPairwiseSubMapper
-
-
Field Summary
Fields Modifier and Type Field Description static String
PROVIDER_ID
-
Fields inherited from class org.keycloak.protocol.oidc.mappers.AbstractPairwiseSubMapper
PROVIDER_ID_SUFFIX
-
Fields inherited from class org.keycloak.protocol.oidc.mappers.AbstractOIDCProtocolMapper
TOKEN_MAPPER_CATEGORY
-
-
Constructor Summary
Constructors Constructor Description SHA256PairwiseSubMapper()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ProtocolMapperRepresentation
createPairwiseMapper(String sectorIdentifierUri, String salt)
String
generateSub(ProtocolMapperModel mappingModel, String sectorIdentifier, String localSub)
Generates a pairwise subject identifier.List<ProviderConfigProperty>
getAdditionalConfigProperties()
Override to add additional provider configuration properties.String
getDisplayType()
String
getHelpText()
String
getIdPrefix()
void
validateAdditionalConfig(KeycloakSession session, RealmModel realm, ProtocolMapperContainerModel mapperContainer, ProtocolMapperModel mapperModel)
Override to add additional configuration validation.-
Methods inherited from class org.keycloak.protocol.oidc.mappers.AbstractPairwiseSubMapper
getConfigProperties, getDisplayCategory, getId, setAccessTokenSubject, setIDTokenSubject, setUserInfoTokenSubject, transformAccessToken, transformIDToken, transformUserInfoToken, validateConfig
-
Methods inherited from class org.keycloak.protocol.oidc.mappers.AbstractOIDCProtocolMapper
close, create, getProtocol, init, postInit, setClaim, setClaim, setClaim, transformAccessTokenResponse
-
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
-
Methods inherited from interface org.keycloak.provider.ProviderFactory
getConfigMetadata, order
-
-
-
-
Field Detail
-
PROVIDER_ID
public static final String PROVIDER_ID
- See Also:
- Constant Field Values
-
-
Method Detail
-
createPairwiseMapper
public static ProtocolMapperRepresentation createPairwiseMapper(String sectorIdentifierUri, String salt)
-
validateAdditionalConfig
public void validateAdditionalConfig(KeycloakSession session, RealmModel realm, ProtocolMapperContainerModel mapperContainer, ProtocolMapperModel mapperModel) throws ProtocolMapperConfigException
Description copied from class:AbstractPairwiseSubMapper
Override to add additional configuration validation. Called when instance of mapperModel is created/updated for this protocolMapper through admin endpoint.- Overrides:
validateAdditionalConfig
in classAbstractPairwiseSubMapper
mapperContainer
- client or clientScope- Throws:
ProtocolMapperConfigException
- if configuration provided in mapperModel is not valid
-
getHelpText
public String getHelpText()
-
getAdditionalConfigProperties
public List<ProviderConfigProperty> getAdditionalConfigProperties()
Description copied from class:AbstractPairwiseSubMapper
Override to add additional provider configuration properties. By default, a pairwise sub mapper will only contain configuration for a sector identifier URI.- Overrides:
getAdditionalConfigProperties
in classAbstractPairwiseSubMapper
- Returns:
- A list of provider configuration properties.
-
generateSub
public String generateSub(ProtocolMapperModel mappingModel, String sectorIdentifier, String localSub)
Description copied from class:AbstractPairwiseSubMapper
Generates a pairwise subject identifier.- Specified by:
generateSub
in classAbstractPairwiseSubMapper
sectorIdentifier
- client sector identifierlocalSub
- local subject identifier (user id)- Returns:
- A pairwise subject identifier
-
getDisplayType
public String getDisplayType()
-
getIdPrefix
public String getIdPrefix()
- Specified by:
getIdPrefix
in classAbstractPairwiseSubMapper
-
-