Class OID4VCMapper

java.lang.Object
org.keycloak.protocol.oid4vc.issuance.mappers.OID4VCMapper
All Implemented Interfaces:
OID4VCEnvironmentProviderFactory, org.keycloak.protocol.ProtocolMapper, org.keycloak.provider.ConfiguredProvider, org.keycloak.provider.EnvironmentDependentProviderFactory, org.keycloak.provider.Provider, org.keycloak.provider.ProviderFactory<org.keycloak.protocol.ProtocolMapper>
Direct Known Subclasses:
OID4VCContextMapper, OID4VCGeneratedIdMapper, OID4VCIssuedAtTimeClaimMapper, OID4VCStaticClaimMapper, OID4VCSubjectIdMapper, OID4VCTargetRoleMapper, OID4VCTypeMapper, OID4VCUserAttributeMapper

public abstract class OID4VCMapper extends Object implements org.keycloak.protocol.ProtocolMapper, OID4VCEnvironmentProviderFactory
Base class for OID4VC Mappers, to provide common configuration and functionality for all of them
Author:
Stefan Wiedemann
  • Field Details

  • Constructor Details

    • OID4VCMapper

      public OID4VCMapper()
  • Method Details

    • getIndividualConfigProperties

      protected abstract List<org.keycloak.provider.ProviderConfigProperty> getIndividualConfigProperties()
    • getConfigProperties

      public List<org.keycloak.provider.ProviderConfigProperty> getConfigProperties()
      Specified by:
      getConfigProperties in interface org.keycloak.provider.ConfiguredProvider
    • setMapperModel

      public OID4VCMapper setMapperModel(org.keycloak.models.ProtocolMapperModel mapperModel, String format)
    • 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

      public List<String> 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

      protected List<String> getAttributePrefix()
    • getProtocol

      public String getProtocol()
      Specified by:
      getProtocol in interface org.keycloak.protocol.ProtocolMapper
    • getDisplayCategory

      public String getDisplayCategory()
      Specified by:
      getDisplayCategory in interface org.keycloak.protocol.ProtocolMapper
    • init

      public void init(org.keycloak.Config.Scope scope)
      Specified by:
      init in interface org.keycloak.provider.ProviderFactory<org.keycloak.protocol.ProtocolMapper>
    • postInit

      public void postInit(org.keycloak.models.KeycloakSessionFactory keycloakSessionFactory)
      Specified by:
      postInit in interface org.keycloak.provider.ProviderFactory<org.keycloak.protocol.ProtocolMapper>
    • close

      public void close()
      Specified by:
      close in interface org.keycloak.provider.Provider
      Specified by:
      close in interface org.keycloak.provider.ProviderFactory<org.keycloak.protocol.ProtocolMapper>
    • setClaim

      public abstract void setClaim(VerifiableCredential verifiableCredential, org.keycloak.models.UserSessionModel userSessionModel)
      Set the claims to credential, like f.e. the context
    • setClaim

      public abstract void setClaim(Map<String,Object> claims, org.keycloak.models.UserSessionModel userSessionModel)
      Set the claims to the credential subject.
    • setClaimWithMetadataPrefix

      public void setClaimWithMetadataPrefix(Map<String,Object> claimsOrig, Map<String,Object> claimsWithPrefix)
      Creates new map "claimsWithPrefix" with the resolved claims including path prefix
      Parameters:
      claimsOrig - Map with the original claims, which were returned by setClaim(Map, UserSessionModel) . This method usually just reads from this map
      claimsWithPrefix - Map with the claims including path prefix. This method might write to this map