Package org.keycloak.models.oid4vci
Class CredentialScopeModel
java.lang.Object
org.keycloak.models.oid4vci.CredentialScopeModel
- All Implemented Interfaces:
org.keycloak.models.ClientScopeModel,org.keycloak.models.OrderedModel,org.keycloak.models.ProtocolMapperContainerModel,org.keycloak.models.ScopeContainerModel
This class acts as delegate for a
ClientScopeModel implementation and adds additional functionality for
OpenId4VC credentials- Author:
- Pascal Knüppel
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.keycloak.models.ClientScopeModel
org.keycloak.models.ClientScopeModel.ClientScopeCreatedEvent, org.keycloak.models.ClientScopeModel.ClientScopeRemovedEventNested classes/interfaces inherited from interface org.keycloak.models.OrderedModel
org.keycloak.models.OrderedModel.OrderedModelComparator<OM extends org.keycloak.models.OrderedModel> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final StringOPTIONAL.static final StringOPTIONAL.static final Stringan optional configuration that can be used to select a specific hash algorithmstatic final Stringstatic final Stringan optional attribute that tells us which attributes should be added into the SD-JWT body.static final Stringstatic final Stringthis attribute holds the 'typ' value that will be added into the JWS header of the credential.static final Stringstatic final Stringstatic final Stringthe credential configuration id as provided in the metadata endpointstatic final Stringthe value that is entered into the "@contexts"-attribute of a verifiable credentialstatic final Stringif the credential is only meant for specific cryptographic binding algorithms the global default list can be overridden here.static final Stringan optional attribute for the metadata endpointstatic final Stringstatic final Integerstatic final Stringstatic final Stringstatic final Stringstatic final Stringthis configuration property can be used to enforce specific claims to be included in the metadata, if they would normally not and vice versastatic final Stringstatic final StringOPTIONAL.static final StringOPTIONAL.static final StringOPTIONAL.static final StringThe interval in seconds at which the wallet should refresh the credential.static final Integerstatic final Stringthis attribute holds a customizable value for the number of decoys to use in a SD-JWT credentialstatic final Integerstatic final StringThe credential signature algorithm.static final Stringan optional configuration that can be used to select a specific key for signing the credentialstatic final Stringthe value that is added into the "types"-attribute of a verifiable credentialstatic final StringFields inherited from interface org.keycloak.models.ClientScopeModel
ALLOW_USER_DATA_ACCESS, CONSENT_SCREEN_TEXT, DISPLAY_ON_CONSENT_SCREEN, DYNAMIC_SCOPE_REGEXP, GUI_ORDER, INCLUDE_IN_OPENID_PROVIDER_METADATA, INCLUDE_IN_TOKEN_SCOPE, IS_ALWAYS_CONSENT, IS_DYNAMIC_SCOPE, IS_PARAMETERIZED_SCOPE, IS_REPEATABLE_SCOPE, PARAMETERIZED_SCOPE_REGEXP, PARAMETERIZED_SCOPE_TYPE, VALUE_SEPARATOR -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.keycloak.models.ProtocolMapperModeladdProtocolMapper(org.keycloak.models.ProtocolMapperModel model) voidaddScopeMapping(org.keycloak.models.RoleModel role) voiddeleteScopeMapping(org.keycloak.models.RoleModel role) getAttribute(String name) static StringgetId()getName()org.keycloak.models.ProtocolMapperModelorg.keycloak.models.ProtocolMapperModelgetProtocolMapperByName(String protocol, String name) List<org.keycloak.models.ProtocolMapperModel>Stream<org.keycloak.models.ProtocolMapperModel>org.keycloak.models.RealmModelgetRealm()Stream<org.keycloak.models.RoleModel>The list of proof types that are required for this credential configuration when binding is required.getScope()Stream<org.keycloak.models.RoleModel>getVct()booleanhasDirectScope(org.keycloak.models.RoleModel role) booleanhasScope(org.keycloak.models.RoleModel role) booleanWhether cryptographic holder binding is required for this credential configuration.booleanbooleanbooleanbooleanvoidremoveAttribute(String name) voidremoveProtocolMapper(org.keycloak.models.ProtocolMapperModel mapping) voidsetAttribute(String name, String value) voidsetBindingRequired(boolean required) voidsetBuildConfigHashAlgorithm(String hashAlgorithm) voidsetBuildConfigSdJwtVisibleClaims(String sdJwtVisibleClaims) voidsetBuildConfigSdJwtVisibleClaims(List<String> sdJwtVisibleClaims) voidsetBuildConfigTokenJwsType(String tokenJwsType) voidsetConsentScreenText(String consentScreenText) voidsetCredentialConfigurationId(String credentialConfigurationId) voidsetCredentialIdentifier(String credentialIdentifier) voidsetCryptographicBindingMethods(String cryptographicBindingMethods) voidsetCryptographicBindingMethods(List<String> cryptographicBindingMethods) voidsetDescription(String description) voidsetDisplayOnConsentScreen(boolean displayOnConsentScreen) voidsetExpiryInSeconds(Integer expiryInSeconds) voidvoidsetGuiOrder(String guiOrder) voidsetIncludeInTokenScope(boolean includeInTokenScope) voidsetIsParameterizedScope(boolean isParameterizedScope) voidsetIssuerDid(String issuerDid) voidsetKeyAttestationRequired(boolean keyAttestationRequired) voidvoidsetProtocol(String protocol) voidsetRefreshIntervalInSeconds(Integer refreshIntervalInSeconds) voidsetRequiredKeyAttestationKeyStorage(List<String> keyStorage) voidsetRequiredKeyAttestationUserAuthentication(List<String> userAuthentication) voidsetRequiredProofTypes(List<String> proofTypes) voidsetSdJwtNumberOfDecoys(Integer sdJwtNumberOfDecoys) voidsetSigningAlg(String signingAlg) voidsetSigningKeyId(String signingKeyId) voidsetSupportedCredentialTypes(String supportedCredentialTypes) voidsetSupportedCredentialTypes(List<String> supportedCredentialTypes) voidsetVcContexts(String vcContexts) voidsetVcContexts(List<String> vcContexts) voidsetVcDisplay(String vcDisplay) voidvoidupdateProtocolMapper(org.keycloak.models.ProtocolMapperModel mapping) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.keycloak.models.ClientScopeModel
getDynamicScopeRegexp, getParameterFromScope, getParameterizedScopeType, isAllowUserDataAccess, isAlwaysConsent, isDynamicScope, isIncludeInOpenIDProviderMetadata, setIncludeInOpenIDProviderMetadata, setIsDynamicScope
-
Field Details
-
CRYPTOGRAPHIC_BINDING_METHODS_DEFAULT
- See Also:
-
VC_BUILD_CONFIG_HASH_ALGORITHM_DEFAULT
- See Also:
-
VC_BUILD_CONFIG_SD_JWT_VISIBLE_CLAIMS_DEFAULT
- See Also:
-
VC_BUILD_CONFIG_TOKEN_JWS_TYPE_DEFAULT_SD_JWT_VC
- See Also:
-
VC_BUILD_CONFIG_TOKEN_JWS_TYPE_DEFAULT_JWT_VC
- See Also:
-
VC_EXPIRY_IN_SECONDS_DEFAULT
-
VC_FORMAT_DEFAULT
- See Also:
-
VC_SD_JWT_NUMBER_OF_DECOYS_DEFAULT
-
VC_CONFIGURATION_ID
the credential configuration id as provided in the metadata endpoint- See Also:
-
VC_IDENTIFIER
- See Also:
-
VC_FORMAT
- See Also:
-
VC_EXPIRY_IN_SECONDS
- See Also:
-
VC_ISSUER_DID
- See Also:
-
VCT
- See Also:
-
VC_SUPPORTED_TYPES
the value that is added into the "types"-attribute of a verifiable credential- See Also:
-
VC_CONTEXTS
the value that is entered into the "@contexts"-attribute of a verifiable credential- See Also:
-
VC_SIGNING_ALG
The credential signature algorithm. If it is not configured, then the realm active key is used to sign the verifiable credential- See Also:
-
VC_CRYPTOGRAPHIC_BINDING_METHODS
if the credential is only meant for specific cryptographic binding algorithms the global default list can be overridden here. The global default list is retrieved from the available keys in the realm.- See Also:
-
VC_SIGNING_KEY_ID
an optional configuration that can be used to select a specific key for signing the credential- See Also:
-
VC_DISPLAY
an optional attribute for the metadata endpoint- See Also:
-
VC_SD_JWT_NUMBER_OF_DECOYS
this attribute holds a customizable value for the number of decoys to use in a SD-JWT credential- See Also:
-
VC_BUILD_CONFIG_SD_JWT_VISIBLE_CLAIMS
an optional attribute that tells us which attributes should be added into the SD-JWT body.- See Also:
-
VC_BUILD_CONFIG_HASH_ALGORITHM
an optional configuration that can be used to select a specific hash algorithm- See Also:
-
VC_BUILD_CONFIG_TOKEN_JWS_TYPE
this attribute holds the 'typ' value that will be added into the JWS header of the credential.- See Also:
-
VC_INCLUDE_IN_METADATA
this configuration property can be used to enforce specific claims to be included in the metadata, if they would normally not and vice versa- See Also:
-
VC_KEY_ATTESTATION_REQUIRED
OPTIONAL. Object that describes the requirement for key attestations as described in Appendix D, which the Credential Issuer expects the Wallet to send within the proof(s) of the Credential Request. If the Credential Issuer does not require a key attestation, this parameter MUST NOT be present in the metadata. If both key_storage and user_authentication parameters are absent, the key_attestations_required parameter may be empty, indicating a key attestation is needed without additional constraints.- See Also:
-
VC_KEY_ATTESTATION_REQUIRED_KEY_STORAGE
OPTIONAL. A non-empty array defining values specified in Appendix D.2 accepted by the Credential Issuer.- See Also:
-
VC_KEY_ATTESTATION_REQUIRED_USER_AUTH
OPTIONAL. A non-empty array defining values specified in Appendix D.2 accepted by the Credential Issuer.- See Also:
-
VC_BINDING_REQUIRED
OPTIONAL. Flag that indicates whether cryptographic holder binding is REQUIRED for this credential configuration. If this flag is not set or set to false, the issuer metadata MUST omit thecryptographic_binding_methods_supportedandproof_types_supportedparameters for this configuration, meaning the wallet is not required to provide cryptographic key material or proofs.If true, the issuer metadata MUST include those parameters and the issuer MUST enforce the corresponding proof types during credential issuance, as per OID4VCI Section 12.2.4.
- See Also:
-
VC_BINDING_REQUIRED_PROOF_TYPES
OPTIONAL. Comma-separated list of proof types that are REQUIRED for this credential configuration whenVC_BINDING_REQUIREDis set to true. Example:"jwt,attestation".If
VC_BINDING_REQUIREDis false or this attribute is empty/absent, no proof types are required and metadata MUST omitcryptographic_binding_methods_supportedandproof_types_supported.- See Also:
-
VC_REFRESH_INTERVAL_IN_SECONDS
The interval in seconds at which the wallet should refresh the credential. This determines the expiration date (`exp` claim) in the actual VC returned to the wallet. If not set, defaults to the smaller of VC_REFRESH_INTERVAL_IN_SECONDS_DEFAULT (7 days) or the credential lifetime.- See Also:
-
VC_REFRESH_INTERVAL_IN_SECONDS_DEFAULT
-
-
Constructor Details
-
CredentialScopeModel
public CredentialScopeModel(org.keycloak.models.ClientScopeModel clientScope)
-
-
Method Details
-
getIssuerDid
-
setIssuerDid
-
getScope
-
getCredentialConfigurationId
-
setCredentialConfigurationId
-
getCredentialIdentifier
-
setCredentialIdentifier
-
getFormat
-
setFormat
-
getExpiryInSeconds
-
setExpiryInSeconds
-
getRefreshIntervalInSeconds
-
setRefreshIntervalInSeconds
-
getSdJwtNumberOfDecoys
-
setSdJwtNumberOfDecoys
-
getVct
-
setVct
-
getBuildConfigTokenJwsType
-
setBuildConfigTokenJwsType
-
getDefaultTokenJwsTypeForFormat
-
getSigningKeyId
-
setSigningKeyId
-
getBuildConfigHashAlgorithm
-
setBuildConfigHashAlgorithm
-
getSupportedCredentialTypes
-
setSupportedCredentialTypes
-
setSupportedCredentialTypes
-
getVcContexts
-
setVcContexts
-
setVcContexts
-
getSigningAlg
-
setSigningAlg
-
getCryptographicBindingMethods
-
setCryptographicBindingMethods
-
setCryptographicBindingMethods
-
getBuildConfigSdJwtVisibleClaims
-
setBuildConfigSdJwtVisibleClaims
-
setBuildConfigSdJwtVisibleClaims
-
getVcDisplay
-
setVcDisplay
-
isBindingRequired
public boolean isBindingRequired()Whether cryptographic holder binding is required for this credential configuration. -
setBindingRequired
public void setBindingRequired(boolean required) -
getRequiredProofTypes
The list of proof types that are required for this credential configuration when binding is required. Returns an empty list if none are configured. -
setRequiredProofTypes
-
isKeyAttestationRequired
public boolean isKeyAttestationRequired() -
setKeyAttestationRequired
public void setKeyAttestationRequired(boolean keyAttestationRequired) -
getRequiredKeyAttestationKeyStorage
-
setRequiredKeyAttestationKeyStorage
-
getRequiredKeyAttestationUserAuthentication
-
setRequiredKeyAttestationUserAuthentication
-
getId
- Specified by:
getIdin interfaceorg.keycloak.models.ClientScopeModel
-
getName
- Specified by:
getNamein interfaceorg.keycloak.models.ClientScopeModel
-
setName
- Specified by:
setNamein interfaceorg.keycloak.models.ClientScopeModel
-
getRealm
public org.keycloak.models.RealmModel getRealm()- Specified by:
getRealmin interfaceorg.keycloak.models.ClientScopeModel
-
getDescription
- Specified by:
getDescriptionin interfaceorg.keycloak.models.ClientScopeModel
-
setDescription
- Specified by:
setDescriptionin interfaceorg.keycloak.models.ClientScopeModel
-
getProtocol
- Specified by:
getProtocolin interfaceorg.keycloak.models.ClientScopeModel
-
setProtocol
- Specified by:
setProtocolin interfaceorg.keycloak.models.ClientScopeModel
-
setAttribute
- Specified by:
setAttributein interfaceorg.keycloak.models.ClientScopeModel
-
removeAttribute
- Specified by:
removeAttributein interfaceorg.keycloak.models.ClientScopeModel
-
getAttribute
- Specified by:
getAttributein interfaceorg.keycloak.models.ClientScopeModel
-
getAttributes
- Specified by:
getAttributesin interfaceorg.keycloak.models.ClientScopeModel
-
isDisplayOnConsentScreen
public boolean isDisplayOnConsentScreen()- Specified by:
isDisplayOnConsentScreenin interfaceorg.keycloak.models.ClientScopeModel
-
setDisplayOnConsentScreen
public void setDisplayOnConsentScreen(boolean displayOnConsentScreen) - Specified by:
setDisplayOnConsentScreenin interfaceorg.keycloak.models.ClientScopeModel
-
getConsentScreenText
- Specified by:
getConsentScreenTextin interfaceorg.keycloak.models.ClientScopeModel
-
setConsentScreenText
- Specified by:
setConsentScreenTextin interfaceorg.keycloak.models.ClientScopeModel
-
getGuiOrder
- Specified by:
getGuiOrderin interfaceorg.keycloak.models.ClientScopeModel- Specified by:
getGuiOrderin interfaceorg.keycloak.models.OrderedModel
-
setGuiOrder
- Specified by:
setGuiOrderin interfaceorg.keycloak.models.ClientScopeModel
-
isIncludeInTokenScope
public boolean isIncludeInTokenScope()- Specified by:
isIncludeInTokenScopein interfaceorg.keycloak.models.ClientScopeModel
-
setIncludeInTokenScope
public void setIncludeInTokenScope(boolean includeInTokenScope) - Specified by:
setIncludeInTokenScopein interfaceorg.keycloak.models.ClientScopeModel
-
isParameterizedScope
public boolean isParameterizedScope()- Specified by:
isParameterizedScopein interfaceorg.keycloak.models.ClientScopeModel
-
setIsParameterizedScope
public void setIsParameterizedScope(boolean isParameterizedScope) - Specified by:
setIsParameterizedScopein interfaceorg.keycloak.models.ClientScopeModel
-
getParameterizedScopeRegexp
- Specified by:
getParameterizedScopeRegexpin interfaceorg.keycloak.models.ClientScopeModel
-
getOid4vcProtocolMappersStream
-
getProtocolMappersStream
- Specified by:
getProtocolMappersStreamin interfaceorg.keycloak.models.ProtocolMapperContainerModel
-
addProtocolMapper
public org.keycloak.models.ProtocolMapperModel addProtocolMapper(org.keycloak.models.ProtocolMapperModel model) - Specified by:
addProtocolMapperin interfaceorg.keycloak.models.ProtocolMapperContainerModel
-
removeProtocolMapper
public void removeProtocolMapper(org.keycloak.models.ProtocolMapperModel mapping) - Specified by:
removeProtocolMapperin interfaceorg.keycloak.models.ProtocolMapperContainerModel
-
updateProtocolMapper
public void updateProtocolMapper(org.keycloak.models.ProtocolMapperModel mapping) - Specified by:
updateProtocolMapperin interfaceorg.keycloak.models.ProtocolMapperContainerModel
-
getProtocolMapperById
- Specified by:
getProtocolMapperByIdin interfaceorg.keycloak.models.ProtocolMapperContainerModel
-
getProtocolMapperByType
- Specified by:
getProtocolMapperByTypein interfaceorg.keycloak.models.ProtocolMapperContainerModel
-
getProtocolMapperByName
public org.keycloak.models.ProtocolMapperModel getProtocolMapperByName(String protocol, String name) - Specified by:
getProtocolMapperByNamein interfaceorg.keycloak.models.ProtocolMapperContainerModel
-
getScopeMappingsStream
- Specified by:
getScopeMappingsStreamin interfaceorg.keycloak.models.ScopeContainerModel
-
getRealmScopeMappingsStream
- Specified by:
getRealmScopeMappingsStreamin interfaceorg.keycloak.models.ScopeContainerModel
-
addScopeMapping
public void addScopeMapping(org.keycloak.models.RoleModel role) - Specified by:
addScopeMappingin interfaceorg.keycloak.models.ScopeContainerModel
-
deleteScopeMapping
public void deleteScopeMapping(org.keycloak.models.RoleModel role) - Specified by:
deleteScopeMappingin interfaceorg.keycloak.models.ScopeContainerModel
-
hasDirectScope
public boolean hasDirectScope(org.keycloak.models.RoleModel role) - Specified by:
hasDirectScopein interfaceorg.keycloak.models.ScopeContainerModel
-
hasScope
public boolean hasScope(org.keycloak.models.RoleModel role) - Specified by:
hasScopein interfaceorg.keycloak.models.ScopeContainerModel
-