Class OID4VCIssuerWellKnownProvider
java.lang.Object
org.keycloak.protocol.oid4vc.issuance.OID4VCIssuerWellKnownProvider
- All Implemented Interfaces:
- Provider,- WellKnownProvider
WellKnownProvider implementation to provide the .well-known/openid-credential-issuer endpoint, offering
 the Credential Issuer Metadata as defined by the OID4VCI protocol
 - Author:
- Stefan Wiedemann
- 
Field SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidclose()generateSignedMetadata(CredentialIssuer metadata, KeycloakSession session) Generates signed metadata as a JWS using JsonWebToken infrastructure.getAuthorizationServers(KeycloakSession session) Return the authorization servers from the issuer configuration.Returns the batch credential issuance configuration for the given realm.Returns the credential request encryption metadata for the issuer.Returns the credential response encryption for the issuer.static StringgetCredentialsEndpoint(KeycloakContext context) Return the credentials endpoint addressstatic StringgetIssuer(KeycloakContext context) Return the url of the issuer.getMetadataResponse(CredentialIssuer issuer, KeycloakSession session) static StringgetNonceEndpoint(KeycloakContext context) Return the nonce endpoint addressReturns the supported asymmetric signature algorithms.getSupportedCredentials(KeycloakSession keycloakSession) Return the supported credentials from the current session.Returns the supported encryption algorithms from realm attributes.toSupportedCredentialConfiguration(KeycloakSession keycloakSession, CredentialScopeModel credentialModel) 
- 
Field Details- 
SIGNED_METADATA_ENABLED_ATTR- See Also:
 
- 
SIGNED_METADATA_LIFESPAN_ATTR- See Also:
 
- 
SIGNED_METADATA_ALG_ATTR- See Also:
 
- 
VC_KEY- See Also:
 
- 
ATTR_ENCRYPTION_REQUIRED- See Also:
 
- 
DEFLATE_COMPRESSION- See Also:
 
- 
ATTR_REQUEST_ZIP_ALGS- See Also:
 
- 
keycloakSession
 
- 
- 
Constructor Details- 
OID4VCIssuerWellKnownProvider
 
- 
- 
Method Details- 
closepublic void close()
- 
getConfig- Specified by:
- getConfigin interface- WellKnownProvider
 
- 
getIssuerMetadata
- 
getMetadataResponse
- 
getBatchCredentialIssuanceReturns the batch credential issuance configuration for the given realm. This method is public and static to facilitate testing without requiring session state management.- Parameters:
- realm- The realm model
- Returns:
- The batch credential issuance configuration or null if not configured or invalid
 
- 
generateSignedMetadataGenerates signed metadata as a JWS using JsonWebToken infrastructure.- Parameters:
- metadata- The CredentialIssuer metadata object to sign.
- session- The Keycloak session.
- Returns:
- Optional containing the compact JWS string if successful, empty if fallback to unsigned JSON is needed.
 
- 
getCredentialResponseEncryptionpublic static CredentialResponseEncryptionMetadata getCredentialResponseEncryption(KeycloakSession session) Returns the credential response encryption for the issuer. Now determines supported algorithms from available realm keys.- Parameters:
- session- The Keycloak session
- Returns:
- The credential response encryption metadata
 
- 
getCredentialRequestEncryptionpublic static CredentialRequestEncryptionMetadata getCredentialRequestEncryption(KeycloakSession session) Returns the credential request encryption metadata for the issuer. Determines supported algorithms and JWK Set from available realm keys
- 
getSupportedEncryptionAlgorithmsReturns the supported encryption algorithms from realm attributes.
- 
getSupportedCredentialspublic static Map<String,SupportedCredentialConfiguration> getSupportedCredentials(KeycloakSession keycloakSession) Return the supported credentials from the current session. It will take into account the configuredCredentialBuilder's and their supported format and the credentials supported by the clients available in the session.
- 
toSupportedCredentialConfigurationpublic static SupportedCredentialConfiguration toSupportedCredentialConfiguration(KeycloakSession keycloakSession, CredentialScopeModel credentialModel) 
- 
getIssuerReturn the url of the issuer.
- 
getNonceEndpointReturn the nonce endpoint address
- 
getCredentialsEndpointReturn the credentials endpoint address
- 
getSupportedSignatureAlgorithms
- 
getAuthorizationServersReturn the authorization servers from the issuer configuration.
- 
getSupportedAsymmetricSignatureAlgorithmsReturns the supported asymmetric signature algorithms. Delegates to CryptoUtils for shared implementation with OIDCWellKnownProvider. This includes all asymmetric algorithms supported by Keycloak (RSA, EC, EdDSA).
 
-