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
FieldsModifier and TypeFieldDescriptionstatic final String
protected String
protected ProtocolMapperModel
static final String
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
This is called when the server shuts down.protected abstract List<ProviderConfigProperty>
must return ordered list of attribute-names as they are added into the credential.boolean
some specific claims should not be added into the metadata.void
init
(Config.Scope scope) Only called once when the factory is first created.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, String format) 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
-
CLAIM_NAME
- See Also:
-
USER_ATTRIBUTE_KEY
- See Also:
-
mapperModel
-
format
-
-
Constructor Details
-
OID4VCMapper
public OID4VCMapper()
-
-
Method Details
-
getIndividualConfigProperties
-
getConfigProperties
- Specified by:
getConfigProperties
in interfaceConfiguredProvider
-
setMapperModel
-
includeInMetadata
public boolean includeInMetadata()some specific claims should not be added into the metadata. Examples are jti, sub, iss etc. Since we have the possibility to add these credentials with specific claims we should also be able to exclude these specific attributes from the metadata -
getMetadataAttributePath
must return ordered list of attribute-names as they are added into the credential. This is required for the metadata endpoint to add the appropriate path-attributes into the claim's description.- Returns:
- the attribute path that is being mapped into the credential
-
getAttributePrefix
-
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>
-
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.
-