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
,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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
This is called when the server shuts down.protected abstract List<ProviderConfigProperty>
void
init
(Config.Scope scope) Only called once when the factory is first created.boolean
isScopeSupported
(String credentialScope) Checks if the mapper supports the given credential type.void
postInit
(KeycloakSessionFactory keycloakSessionFactory) Called after all provider factories have been initializedabstract void
setClaimsForCredential
(VerifiableCredential verifiableCredential, UserSessionModel userSessionModel) Set the claims to credential, like f.e.abstract void
setClaimsForSubject
(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, wait
Methods inherited from interface org.keycloak.provider.ConfiguredProvider
getConfig, getHelpText
Methods inherited from interface org.keycloak.protocol.oid4vc.OID4VCEnvironmentProviderFactory
isSupported
Methods inherited from interface org.keycloak.protocol.ProtocolMapper
getDisplayType, getEffectiveModel, getPriority, validateConfig
Methods 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:
getConfigProperties
in interfaceConfiguredProvider
-
setMapperModel
-
getProtocol
- Specified by:
getProtocol
in interfaceProtocolMapper
-
getDisplayCategory
- Specified by:
getDisplayCategory
in interfaceProtocolMapper
-
init
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>
-
postInit
Description copied from interface:ProviderFactory
Called after all provider factories have been initialized- Specified by:
postInit
in interfaceProviderFactory<ProtocolMapper>
-
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>
-
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.
-