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 Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
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 String
getCredentialsEndpoint
(KeycloakContext context) Return the credentials endpoint addressstatic String
getIssuer
(KeycloakContext context) Return the url of the issuer.getMetadataResponse
(CredentialIssuer issuer, KeycloakSession session) static String
getNonceEndpoint
(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
-
close
public void close() -
getConfig
- Specified by:
getConfig
in interfaceWellKnownProvider
-
getIssuerMetadata
-
getMetadataResponse
-
getBatchCredentialIssuance
Returns 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
-
generateSignedMetadata
Generates 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.
-
getCredentialResponseEncryption
public 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
-
getCredentialRequestEncryption
public static CredentialRequestEncryptionMetadata getCredentialRequestEncryption(KeycloakSession session) Returns the credential request encryption metadata for the issuer. Determines supported algorithms and JWK Set from available realm keys -
getSupportedEncryptionAlgorithms
Returns the supported encryption algorithms from realm attributes. -
getSupportedCredentials
public 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. -
toSupportedCredentialConfiguration
public static SupportedCredentialConfiguration toSupportedCredentialConfiguration(KeycloakSession keycloakSession, CredentialScopeModel credentialModel) -
getIssuer
Return the url of the issuer. -
getNonceEndpoint
Return the nonce endpoint address -
getCredentialsEndpoint
Return the credentials endpoint address -
getSupportedSignatureAlgorithms
-
getAuthorizationServers
Return the authorization servers from the issuer configuration. -
getSupportedAsymmetricSignatureAlgorithms
Returns the supported asymmetric signature algorithms. Delegates to CryptoUtils for shared implementation with OIDCWellKnownProvider. This includes all asymmetric algorithms supported by Keycloak (RSA, EC, EdDSA).
-