Class OID4VCMapper
java.lang.Object
org.keycloak.protocol.oid4vc.issuance.mappers.OID4VCMapper
- All Implemented Interfaces:
OID4VCEnvironmentProviderFactory,ProtocolMapper,ConfiguredProvider,EnvironmentDependentProviderFactory,Provider,ProviderFactory<ProtocolMapper>
- Direct Known Subclasses:
OID4VCContextMapper,OID4VCGeneratedIdMapper,OID4VCIssuedAtTimeClaimMapper,OID4VCStaticClaimMapper,OID4VCSubjectIdMapper,OID4VCTargetRoleMapper,OID4VCTypeMapper,OID4VCUserAttributeMapper
public abstract class OID4VCMapper
extends Object
implements ProtocolMapper, OID4VCEnvironmentProviderFactory
Base class for OID4VC Mappers, to provide common configuration and functionality for all of them
- Author:
- Stefan Wiedemann
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()This is called when the server shuts down.protected abstract List<ProviderConfigProperty>voidinit(Config.Scope scope) Only called once when the factory is first created.booleanisScopeSupported(String credentialScope) Checks if the mapper supports the given credential type.voidpostInit(KeycloakSessionFactory keycloakSessionFactory) Called after all provider factories have been initializedabstract voidsetClaimsForCredential(VerifiableCredential verifiableCredential, UserSessionModel userSessionModel) Set the claims to credential, like f.e.abstract voidsetClaimsForSubject(Map<String, Object> claims, UserSessionModel userSessionModel) Set the claims to the credential subject.setMapperModel(ProtocolMapperModel mapperModel) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.keycloak.provider.ConfiguredProvider
getConfig, getHelpTextMethods inherited from interface org.keycloak.protocol.oid4vc.OID4VCEnvironmentProviderFactory
isSupportedMethods inherited from interface org.keycloak.protocol.ProtocolMapper
getDisplayType, getEffectiveModel, getPriority, validateConfigMethods inherited from interface org.keycloak.provider.ProviderFactory
create, dependsOn, getConfigMetadata, getId, order
-
Field Details
-
SUPPORTED_CREDENTIALS_KEY
- See Also:
-
mapperModel
-
-
Constructor Details
-
OID4VCMapper
public OID4VCMapper()
-
-
Method Details
-
getIndividualConfigProperties
-
getConfigProperties
- Specified by:
getConfigPropertiesin interfaceConfiguredProvider
-
setMapperModel
-
getProtocol
- Specified by:
getProtocolin interfaceProtocolMapper
-
getDisplayCategory
- Specified by:
getDisplayCategoryin interfaceProtocolMapper
-
init
Description copied from interface:ProviderFactoryOnly called once when the factory is first created. This config is pulled from keycloak_server.json- Specified by:
initin interfaceProviderFactory<ProtocolMapper>
-
postInit
Description copied from interface:ProviderFactoryCalled after all provider factories have been initialized- Specified by:
postInitin interfaceProviderFactory<ProtocolMapper>
-
close
public void close()Description copied from interface:ProviderFactoryThis is called when the server shuts down.- Specified by:
closein interfaceProvider- Specified by:
closein interfaceProviderFactory<ProtocolMapper>
-
isScopeSupported
Checks if the mapper supports the given credential type. Allows to configure them not only per client, but also per VC Type.- Parameters:
credentialScope- type of the VerifiableCredential that should be checked- Returns:
- true if it is supported
-
setClaimsForCredential
public abstract void setClaimsForCredential(VerifiableCredential verifiableCredential, UserSessionModel userSessionModel) Set the claims to credential, like f.e. the context -
setClaimsForSubject
public abstract void setClaimsForSubject(Map<String, Object> claims, UserSessionModel userSessionModel) Set the claims to the credential subject.
-