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 Stringprotected Stringprotected ProtocolMapperModelstatic final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()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.booleansome specific claims should not be added into the metadata.voidinit(Config.Scope scope) Only called once when the factory is first created.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, String format) 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
-
CLAIM_NAME
- See Also:
-
USER_ATTRIBUTE_KEY
- See Also:
-
mapperModel
-
format
-
-
Constructor Details
-
OID4VCMapper
public OID4VCMapper()
-
-
Method Details
-
getIndividualConfigProperties
-
getConfigProperties
- Specified by:
getConfigPropertiesin 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:
getProtocolin interfaceProtocolMapper
-
getDisplayCategory
- Specified by:
getDisplayCategoryin interfaceProtocolMapper
-
init
Description copied from interface:ProviderFactoryOnly called once when the factory is first created.- 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>
-
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.
-