Package org.keycloak.models.oid4vci
Class CredentialScopeModel
java.lang.Object
org.keycloak.models.oid4vci.CredentialScopeModel
- All Implemented Interfaces:
ClientScopeModel
,OrderedModel
,ProtocolMapperContainerModel
,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
ClientScopeModel.ClientScopeCreatedEvent, ClientScopeModel.ClientScopeRemovedEvent
Nested classes/interfaces inherited from interface org.keycloak.models.OrderedModel
OrderedModel.OrderedModelComparator<OM extends OrderedModel>
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
static final String
the value that is entered into the "@contexts"-attribute of a verifiable credentialstatic final String
static final String
if the credential is only meant for specific cryptographic binding algorithms the global default list can be overridden here.static final String
static final String
static final int
static final String
static final String
static final String
an optional configuration that can be used to select a specific hash algorithmstatic final String
static final String
this configuration property can be used to enforce specific claims to be included in the metadata, if they would normally not and vice versastatic final String
the credential configuration id as provided in the metadata endpointstatic final int
static final String
this attribute holds a customizable value for the number of decoys to use in a SD-JWT credentialstatic final String
an optional attribute that tells us which attributes should be added into the SD-JWT body.static final String
static final String
if the credential is only meant for specific signing algorithms the global default list can be overridden here.static final String
an optional configuration that can be used to select a specific key for signing the credentialstatic final String
this attribute holds the 'typ' value that will be added into the JWS header of the credential.static final String
static final String
the value that is added into the "types"-attribute of a verifiable credentialstatic final String
an optional attribute for the metadata endpointstatic final String
Fields inherited from interface org.keycloak.models.ClientScopeModel
CONSENT_SCREEN_TEXT, DISPLAY_ON_CONSENT_SCREEN, DYNAMIC_SCOPE_REGEXP, GUI_ORDER, INCLUDE_IN_TOKEN_SCOPE, IS_DYNAMIC_SCOPE, VALUE_SEPARATOR
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addScopeMapping
(RoleModel role) void
deleteScopeMapping
(RoleModel role) getAttribute
(String name) getId()
getName()
getProtocolMapperByName
(String protocol, String name) Returns protocol mappers as a stream.getRealm()
From the scope mappings returned byScopeContainerModel.getScopeMappingsStream()
returns only those that belong to the realm that owns this scope container.getScope()
Returns scope mappings for this scope container as a stream.int
getVct()
boolean
hasDirectScope
(RoleModel role) Returnstrue
, if this object has the given role directly in its scope.boolean
Returnstrue
, if this object has the given role directly or indirectly in its scope,false
otherwise.boolean
boolean
boolean
void
removeAttribute
(String name) void
removeProtocolMapper
(ProtocolMapperModel mapping) void
setAttribute
(String name, String value) void
setConsentScreenText
(String consentScreenText) void
setCredentialConfigurationId
(String credentialConfigurationId) void
setCredentialIdentifier
(String credentialIdentifier) void
setCryptographicBindingMethods
(String cryptographicBindingMethods) void
setCryptographicBindingMethods
(List<String> cryptographicBindingMethods) void
setDescription
(String description) void
setDisplayOnConsentScreen
(boolean displayOnConsentScreen) void
setExpiryInSeconds
(Integer expiryInSeconds) void
void
setGuiOrder
(String guiOrder) void
setHashAlgorithm
(String hashAlgorithm) void
setIncludeInTokenScope
(boolean includeInTokenScope) void
setIsDynamicScope
(boolean isDynamicScope) void
setIssuerDid
(String issuerDid) void
void
setProtocol
(String protocol) void
setSdJwtNumberOfDecoys
(Integer sdJwtNumberOfDecoys) void
setSdJwtVisibleClaims
(String sdJwtVisibleClaims) void
setSdJwtVisibleClaims
(List<String> sdJwtVisibleClaims) void
setSigningAlgsSupported
(String signingAlgsSupported) void
setSigningAlgsSupported
(List<String> signingAlgsSupported) void
setSigningKeyId
(String signingKeyId) void
setSupportedCredentialTypes
(String supportedCredentialTypes) void
setSupportedCredentialTypes
(List<String> supportedCredentialTypes) void
setTokenJwsType
(String tokenJwsType) void
setVcContexts
(String vcContexts) void
setVcContexts
(List<String> vcContexts) void
setVcDisplay
(String vcDisplay) void
void
updateProtocolMapper
(ProtocolMapperModel mapping)
-
Field Details
-
SD_JWT_VISIBLE_CLAIMS_DEFAULT
- See Also:
-
SD_JWT_DECOYS_DEFAULT
public static final int SD_JWT_DECOYS_DEFAULT- See Also:
-
FORMAT_DEFAULT
- See Also:
-
HASH_ALGORITHM_DEFAULT
- See Also:
-
TOKEN_TYPE_DEFAULT
- See Also:
-
EXPIRY_IN_SECONDS_DEFAULT
public static final int EXPIRY_IN_SECONDS_DEFAULT- See Also:
-
CRYPTOGRAPHIC_BINDING_METHODS_DEFAULT
- See Also:
-
ISSUER_DID
the credential configuration id as provided in the metadata endpoint- See Also:
-
CONFIGURATION_ID
- See Also:
-
CREDENTIAL_IDENTIFIER
- See Also:
-
FORMAT
- See Also:
-
EXPIRY_IN_SECONDS
- See Also:
-
VCT
- See Also:
-
TYPES
the value that is added into the "types"-attribute of a verifiable credential- See Also:
-
CONTEXTS
the value that is entered into the "@contexts"-attribute of a verifiable credential- See Also:
-
SIGNING_ALG_VALUES_SUPPORTED
if the credential is only meant for specific signing algorithms the global default list can be overridden here. The global default list is retrieved from the available keys in the realm.- See Also:
-
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:
-
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:
-
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:
-
SD_JWT_VISIBLE_CLAIMS
an optional attribute that tells us which attributes should be added into the SD-JWT body.- See Also:
-
HASH_ALGORITHM
an optional configuration that can be used to select a specific hash algorithm- See Also:
-
TOKEN_JWS_TYPE
this attribute holds the 'typ' value that will be added into the JWS header of the credential.- See Also:
-
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:
-
-
Constructor Details
-
CredentialScopeModel
-
-
Method Details
-
getIssuerDid
-
setIssuerDid
-
getScope
-
getCredentialConfigurationId
-
setCredentialConfigurationId
-
getCredentialIdentifier
-
setCredentialIdentifier
-
getFormat
-
setFormat
-
getExpiryInSeconds
-
setExpiryInSeconds
-
getSdJwtNumberOfDecoys
public int getSdJwtNumberOfDecoys() -
setSdJwtNumberOfDecoys
-
getVct
-
setVct
-
getTokenJwsType
-
setTokenJwsType
-
getSigningKeyId
-
setSigningKeyId
-
getHashAlgorithm
-
setHashAlgorithm
-
getSupportedCredentialTypes
-
setSupportedCredentialTypes
-
setSupportedCredentialTypes
-
getVcContexts
-
setVcContexts
-
setVcContexts
-
getSigningAlgsSupported
-
setSigningAlgsSupported
-
setSigningAlgsSupported
-
getCryptographicBindingMethods
-
setCryptographicBindingMethods
-
setCryptographicBindingMethods
-
getSdJwtVisibleClaims
-
setSdJwtVisibleClaims
-
setSdJwtVisibleClaims
-
getVcDisplay
-
setVcDisplay
-
getId
- Specified by:
getId
in interfaceClientScopeModel
-
getName
- Specified by:
getName
in interfaceClientScopeModel
-
setName
- Specified by:
setName
in interfaceClientScopeModel
-
getRealm
- Specified by:
getRealm
in interfaceClientScopeModel
-
getDescription
- Specified by:
getDescription
in interfaceClientScopeModel
-
setDescription
- Specified by:
setDescription
in interfaceClientScopeModel
-
getProtocol
- Specified by:
getProtocol
in interfaceClientScopeModel
-
setProtocol
- Specified by:
setProtocol
in interfaceClientScopeModel
-
setAttribute
- Specified by:
setAttribute
in interfaceClientScopeModel
-
removeAttribute
- Specified by:
removeAttribute
in interfaceClientScopeModel
-
getAttribute
- Specified by:
getAttribute
in interfaceClientScopeModel
-
getAttributes
- Specified by:
getAttributes
in interfaceClientScopeModel
-
isDisplayOnConsentScreen
public boolean isDisplayOnConsentScreen()- Specified by:
isDisplayOnConsentScreen
in interfaceClientScopeModel
-
setDisplayOnConsentScreen
public void setDisplayOnConsentScreen(boolean displayOnConsentScreen) - Specified by:
setDisplayOnConsentScreen
in interfaceClientScopeModel
-
getConsentScreenText
- Specified by:
getConsentScreenText
in interfaceClientScopeModel
-
setConsentScreenText
- Specified by:
setConsentScreenText
in interfaceClientScopeModel
-
getGuiOrder
- Specified by:
getGuiOrder
in interfaceClientScopeModel
- Specified by:
getGuiOrder
in interfaceOrderedModel
-
setGuiOrder
- Specified by:
setGuiOrder
in interfaceClientScopeModel
-
isIncludeInTokenScope
public boolean isIncludeInTokenScope()- Specified by:
isIncludeInTokenScope
in interfaceClientScopeModel
-
setIncludeInTokenScope
public void setIncludeInTokenScope(boolean includeInTokenScope) - Specified by:
setIncludeInTokenScope
in interfaceClientScopeModel
-
isDynamicScope
public boolean isDynamicScope()- Specified by:
isDynamicScope
in interfaceClientScopeModel
-
setIsDynamicScope
public void setIsDynamicScope(boolean isDynamicScope) - Specified by:
setIsDynamicScope
in interfaceClientScopeModel
-
getDynamicScopeRegexp
- Specified by:
getDynamicScopeRegexp
in interfaceClientScopeModel
-
getOid4vcProtocolMappersStream
-
getProtocolMappersStream
Description copied from interface:ProtocolMapperContainerModel
Returns protocol mappers as a stream.- Specified by:
getProtocolMappersStream
in interfaceProtocolMapperContainerModel
- Returns:
- Stream of protocol mapper. Never returns
null
.
-
addProtocolMapper
- Specified by:
addProtocolMapper
in interfaceProtocolMapperContainerModel
-
removeProtocolMapper
- Specified by:
removeProtocolMapper
in interfaceProtocolMapperContainerModel
-
updateProtocolMapper
- Specified by:
updateProtocolMapper
in interfaceProtocolMapperContainerModel
-
getProtocolMapperById
- Specified by:
getProtocolMapperById
in interfaceProtocolMapperContainerModel
-
getProtocolMapperByName
- Specified by:
getProtocolMapperByName
in interfaceProtocolMapperContainerModel
-
getScopeMappingsStream
Description copied from interface:ScopeContainerModel
Returns scope mappings for this scope container as a stream.- Specified by:
getScopeMappingsStream
in interfaceScopeContainerModel
- Returns:
- Stream of
RoleModel
. Never returnsnull
.
-
getRealmScopeMappingsStream
Description copied from interface:ScopeContainerModel
From the scope mappings returned byScopeContainerModel.getScopeMappingsStream()
returns only those that belong to the realm that owns this scope container.- Specified by:
getRealmScopeMappingsStream
in interfaceScopeContainerModel
- Returns:
- stream of
RoleModel
. Never returnsnull
.
-
addScopeMapping
- Specified by:
addScopeMapping
in interfaceScopeContainerModel
-
deleteScopeMapping
- Specified by:
deleteScopeMapping
in interfaceScopeContainerModel
-
hasDirectScope
Description copied from interface:ScopeContainerModel
Returnstrue
, if this object has the given role directly in its scope.- Specified by:
hasDirectScope
in interfaceScopeContainerModel
- Parameters:
role
- the role- Returns:
- see description
- See Also:
-
hasScope
Description copied from interface:ScopeContainerModel
Returnstrue
, if this object has the given role directly or indirectly in its scope,false
otherwise.- Specified by:
hasScope
in interfaceScopeContainerModel
- Parameters:
role
- the role- Returns:
- see description
- See Also:
-