Class OIDCClientMetadata
java.lang.Object
com.nimbusds.oauth2.sdk.client.ClientMetadata
com.nimbusds.openid.connect.sdk.rp.OIDCClientMetadata
OpenID Connect client metadata.
Related specifications:
- OpenID Connect Dynamic Client Registration 1.0, section 2.
- OpenID Connect Session Management 1.0, section 5.1.1 (draft 28).
- OpenID Connect Front-Channel Logout 1.0, section 2 (draft 02).
- OpenID Connect Back-Channel Logout 1.0, section 2.2 (draft 07).
- OpenID Connect for Identity Assurance 1.0 (draft 12).
- OpenID Connect Federation 1.0 (draft 14).
- OAuth 2.0 Dynamic Client Registration Protocol (RFC 7591), section 2.
- OAuth 2.0 Mutual TLS Client Authentication and Certificate Bound Access Tokens (RFC 8705), sections 2.1.2 and 3.4.
- OAuth 2.0 Demonstrating Proof of Possession (DPoP) (RFC 9449), section 5.2.
- Financial-grade API: JWT Secured Authorization Response Mode for OAuth 2.0 (JARM)
- OAuth 2.0 Pushed Authorization Requests (RFC 9126)
- OAuth 2.0 Rich Authorization Requests (RFC 9396), section 10.
-
Field Summary
Fields inherited from class com.nimbusds.oauth2.sdk.client.ClientMetadata
PROHIBITED_REDIRECT_URI_SCHEMES
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new OpenID Connect client metadata instance.OIDCClientMetadata
(ClientMetadata metadata) Creates a new OpenID Connect client metadata instance from the specified base OAuth 2.0 client metadata.OIDCClientMetadata
(OIDCClientMetadata metadata) Creates a shallow copy of the specified OpenID Connect client metadata instance. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Applies the client metadata defaults where no values have been specified.Gets the client application type.Gets the digest algorithm for the external evidence attachments in OpenID Connect for Identity Assurance 1.0.Gets the back-channel logout URI.Gets the default Authentication Context Class Reference (ACR) values.int
Gets the default maximum authentication age.Gets the front-channel logout URI.com.nimbusds.jose.JWEAlgorithm
Gets the JSON Web Encryption (JWE) algorithm required for the ID Tokens issued to this client.com.nimbusds.jose.EncryptionMethod
Gets the JSON Web Encryption (JWE) method required for the ID Tokens issued to this client.com.nimbusds.jose.JWSAlgorithm
Gets the JSON Web Signature (JWS) algorithm required for the ID Tokens issued to this client.Gets the HTTPS URI that the authorisation server can call to initiate a login at the client.Gets the post logout redirection URIs.Gets the registered (standard) OpenID Connect client metadata parameter names.Gets the sector identifier URI.Gets the subject identifier type for responses to this client.com.nimbusds.jose.JWEAlgorithm
Gets the JSON Web Encryption (JWE) algorithm required for the UserInfo responses to this client.com.nimbusds.jose.EncryptionMethod
Gets the JSON Web Encryption (JWE) method required for the UserInfo responses to this client.com.nimbusds.jose.JWSAlgorithm
Gets the JSON Web Signature (JWS) algorithm required for the UserInfo responses to this client.static OIDCClientMetadata
parse
(net.minidev.json.JSONObject jsonObject) Parses an OpenID Connect client metadata instance from the specified JSON object.boolean
Gets the default requirement for theauth_time
claim in the ID Token.void
requiresAuthTime
(boolean requiresAuthTime) Sets the default requirement for theauth_time
claim in the ID Token.boolean
Gets the requirement for a session identifier on back-channel logout.void
requiresBackChannelLogoutSession
(boolean requiresSession) Sets the requirement for a session identifier on back-channel logout.boolean
Gets the requirement for a session identifier on front-channel logout.void
requiresFrontChannelLogoutSession
(boolean requiresSession) Sets the requirement for a session identifier on front-channel logout.Resolves the sector identifier from the client metadata.void
setApplicationType
(ApplicationType applicationType) Sets the client application type.void
setAttachmentDigestAlg
(HashAlgorithm hashAlg) Sets the digest algorithm for the external evidence attachments in OpenID Connect for Identity Assurance 1.0.void
setBackChannelLogoutURI
(URI backChannelLogoutURI) Sets the back-channel logout URI.void
setDefaultACRs
(List<ACR> defaultACRs) Sets the default Authentication Context Class Reference (ACR) values.void
setDefaultMaxAge
(int defaultMaxAge) Sets the default maximum authentication age.void
setFrontChannelLogoutURI
(URI frontChannelLogoutURI) Sets the front-channel logout URI.void
setIDTokenJWEAlg
(com.nimbusds.jose.JWEAlgorithm idTokenJWEAlg) Sets the JSON Web Encryption (JWE) algorithm required for the ID Tokens issued to this client.void
setIDTokenJWEEnc
(com.nimbusds.jose.EncryptionMethod idTokenJWEEnc) Sets the JSON Web Encryption (JWE) method required for the ID Tokens issued to this client.void
setIDTokenJWSAlg
(com.nimbusds.jose.JWSAlgorithm idTokenJWSAlg) Sets the JSON Web Signature (JWS) algorithm required for the ID Tokens issued to this client.void
setInitiateLoginURI
(URI loginURI) Sets the HTTPS URI that the authorisation server can call to initiate a login at the client.void
setPostLogoutRedirectionURIs
(Set<URI> logoutURIs) Sets the post logout redirection URIs.void
setSectorIDURI
(URI sectorIDURI) Sets the sector identifier URI.void
setSubjectType
(SubjectType subjectType) Sets the subject identifier type for responses to this client.void
setUserInfoJWEAlg
(com.nimbusds.jose.JWEAlgorithm userInfoJWEAlg) Sets the JSON Web Encryption (JWE) algorithm required for the UserInfo responses to this client.void
setUserInfoJWEEnc
(com.nimbusds.jose.EncryptionMethod userInfoJWEEnc) Sets the JSON Web Encryption (JWE) method required for the UserInfo responses to this client.void
setUserInfoJWSAlg
(com.nimbusds.jose.JWSAlgorithm userInfoJWSAlg) Sets the JSON Web Signature (JWS) algorithm required for the UserInfo responses to this client.net.minidev.json.JSONObject
toJSONObject
(boolean includeCustomFields) Returns the JSON object representation of this client metadata.Methods inherited from class com.nimbusds.oauth2.sdk.client.ClientMetadata
getAuthorizationDetailsTypes, getAuthorizationJWEAlg, getAuthorizationJWEEnc, getAuthorizationJWSAlg, getBackChannelAuthRequestJWSAlg, getBackChannelClientNotificationEndpoint, getBackChannelTokenDeliveryMode, getClientRegistrationTypes, getCustomField, getCustomFields, getDPoPBoundAccessTokens, getEmailContacts, getGrantTypes, getJWKSet, getJWKSetURI, getLogoURI, getLogoURI, getLogoURIEntries, getMutualTLSSenderConstrainedAccessTokens, getName, getName, getNameEntries, getOrganizationName, getPolicyURI, getPolicyURI, getPolicyURIEntries, getRedirectionURI, getRedirectionURIs, getRedirectionURIStrings, getRequestObjectJWEAlg, getRequestObjectJWEEnc, getRequestObjectJWSAlg, getRequestObjectURIs, getResponseTypes, getScope, getSignedJWKSetURI, getSoftwareID, getSoftwareStatement, getSoftwareVersion, getTermsOfServiceURI, getTermsOfServiceURI, getTermsOfServiceURIEntries, getTLSClientAuthSanDNS, getTLSClientAuthSanEmail, getTLSClientAuthSanIP, getTLSClientAuthSanURI, getTLSClientAuthSubjectDN, getTLSClientCertificateBoundAccessTokens, getTokenEndpointAuthJWSAlg, getTokenEndpointAuthMethod, getURI, getURI, getURIEntries, hasScopeValue, requiresPushedAuthorizationRequests, requiresPushedAuthorizationRequests, setAuthorizationDetailsTypes, setAuthorizationJWEAlg, setAuthorizationJWEEnc, setAuthorizationJWSAlg, setBackChannelAuthRequestJWSAlg, setBackChannelClientNotificationEndpoint, setBackChannelTokenDeliveryMode, setClientRegistrationTypes, setCustomField, setCustomFields, setDPoPBoundAccessTokens, setEmailContacts, setGrantTypes, setJWKSet, setJWKSetURI, setLogoURI, setLogoURI, setMutualTLSSenderConstrainedAccessTokens, setName, setName, setOrganizationName, setPolicyURI, setPolicyURI, setRedirectionURI, setRedirectionURIs, setRequestObjectJWEAlg, setRequestObjectJWEEnc, setRequestObjectJWSAlg, setRequestObjectURIs, setResponseTypes, setScope, setSignedJWKSetURI, setSoftwareID, setSoftwareStatement, setSoftwareVersion, setSupportsBackChannelUserCodeParam, setTermsOfServiceURI, setTermsOfServiceURI, setTLSClientAuthSanDNS, setTLSClientAuthSanEmail, setTLSClientAuthSanIP, setTLSClientAuthSanURI, setTLSClientAuthSubjectDN, setTLSClientCertificateBoundAccessTokens, setTokenEndpointAuthJWSAlg, setTokenEndpointAuthMethod, setURI, setURI, supportsBackChannelUserCodeParam, toJSONObject, toString
-
Constructor Details
-
OIDCClientMetadata
public OIDCClientMetadata()Creates a new OpenID Connect client metadata instance. -
OIDCClientMetadata
Creates a new OpenID Connect client metadata instance from the specified base OAuth 2.0 client metadata.- Parameters:
metadata
- The base OAuth 2.0 client metadata. Must not benull
.
-
OIDCClientMetadata
Creates a shallow copy of the specified OpenID Connect client metadata instance.- Parameters:
metadata
- The client metadata to copy. Must not benull
.
-
-
Method Details
-
getRegisteredParameterNames
Gets the registered (standard) OpenID Connect client metadata parameter names.- Returns:
- The registered OpenID Connect parameter names, as an unmodifiable set.
-
getApplicationType
Gets the client application type. Corresponds to theapplication_type
client metadata field.- Returns:
- The client application type,
null
if not specified.
-
setApplicationType
Sets the client application type. Corresponds to theapplication_type
client metadata field.- Parameters:
applicationType
- The client application type,null
if not specified.
-
getSubjectType
Gets the subject identifier type for responses to this client. Corresponds to thesubject_type
client metadata field.- Returns:
- The subject identifier type,
null
if not specified.
-
setSubjectType
Sets the subject identifier type for responses to this client. Corresponds to thesubject_type
client metadata field.- Parameters:
subjectType
- The subject identifier type,null
if not specified.
-
getSectorIDURI
Gets the sector identifier URI. Corresponds to thesector_identifier_uri
client metadata field.- Returns:
- The sector identifier URI,
null
if not specified.
-
setSectorIDURI
Sets the sector identifier URI. Corresponds to thesector_identifier_uri
client metadata field. If set the URI will be checked for having anhttps
scheme and a host component unless the URI is an URN.- Parameters:
sectorIDURI
- The sector identifier URI,null
if not specified.- Throws:
IllegalArgumentException
- If the URI was found to be illegal.
-
resolveSectorID
Resolves the sector identifier from the client metadata.- Returns:
- The sector identifier,
null
if the subject type is set to public. - Throws:
IllegalStateException
- If resolution failed due to incomplete or inconsistent metadata.
-
getIDTokenJWSAlg
Gets the JSON Web Signature (JWS) algorithm required for the ID Tokens issued to this client. Corresponds to theid_token_signed_response_alg
client metadata field.- Returns:
- The JWS algorithm,
null
if not specified.
-
setIDTokenJWSAlg
Sets the JSON Web Signature (JWS) algorithm required for the ID Tokens issued to this client. Corresponds to theid_token_signed_response_alg
client metadata field.- Parameters:
idTokenJWSAlg
- The JWS algorithm,null
if not specified.
-
getIDTokenJWEAlg
Gets the JSON Web Encryption (JWE) algorithm required for the ID Tokens issued to this client. Corresponds to theid_token_encrypted_response_alg
client metadata field.- Returns:
- The JWE algorithm,
null
if not specified.
-
setIDTokenJWEAlg
Sets the JSON Web Encryption (JWE) algorithm required for the ID Tokens issued to this client. Corresponds to theid_token_encrypted_response_alg
client metadata field.- Parameters:
idTokenJWEAlg
- The JWE algorithm,null
if not specified.
-
getIDTokenJWEEnc
Gets the JSON Web Encryption (JWE) method required for the ID Tokens issued to this client. Corresponds to theid_token_encrypted_response_enc
client metadata field.- Returns:
- The JWE method,
null
if not specified.
-
setIDTokenJWEEnc
Sets the JSON Web Encryption (JWE) method required for the ID Tokens issued to this client. Corresponds to theid_token_encrypted_response_enc
client metadata field.- Parameters:
idTokenJWEEnc
- The JWE method,null
if not specified.
-
getUserInfoJWSAlg
Gets the JSON Web Signature (JWS) algorithm required for the UserInfo responses to this client. Corresponds to theuserinfo_signed_response_alg
client metadata field.- Returns:
- The JWS algorithm,
null
if not specified.
-
setUserInfoJWSAlg
Sets the JSON Web Signature (JWS) algorithm required for the UserInfo responses to this client. Corresponds to theuserinfo_signed_response_alg
client metadata field.- Parameters:
userInfoJWSAlg
- The JWS algorithm,null
if not specified.
-
getUserInfoJWEAlg
Gets the JSON Web Encryption (JWE) algorithm required for the UserInfo responses to this client. Corresponds to theuserinfo_encrypted_response_alg
client metadata field.- Returns:
- The JWE algorithm,
null
if not specified.
-
setUserInfoJWEAlg
Sets the JSON Web Encryption (JWE) algorithm required for the UserInfo responses to this client. Corresponds to theuserinfo_encrypted_response_alg
client metadata field.- Parameters:
userInfoJWEAlg
- The JWE algorithm,null
if not specified.
-
getUserInfoJWEEnc
Gets the JSON Web Encryption (JWE) method required for the UserInfo responses to this client. Corresponds to theuserinfo_encrypted_response_enc
client metadata field.- Returns:
- The JWE method,
null
if not specified.
-
setUserInfoJWEEnc
Sets the JSON Web Encryption (JWE) method required for the UserInfo responses to this client. Corresponds to theuserinfo_encrypted_response_enc
client metadata field.- Parameters:
userInfoJWEEnc
- The JWE method,null
if not specified.
-
getDefaultMaxAge
Gets the default maximum authentication age. Corresponds to thedefault_max_age
client metadata field.- Returns:
- The default max authentication age, in seconds. If not specified -1.
-
setDefaultMaxAge
Sets the default maximum authentication age. Corresponds to thedefault_max_age
client metadata field.- Parameters:
defaultMaxAge
- The default max authentication age, in seconds. If not specified -1.
-
requiresAuthTime
Gets the default requirement for theauth_time
claim in the ID Token. Corresponds to therequire_auth_time
client metadata field.- Returns:
- If
true
theauth_Time
claim in the ID Token is required by default.
-
requiresAuthTime
Sets the default requirement for theauth_time
claim in the ID Token. Corresponds to therequire_auth_time
client metadata field.- Parameters:
requiresAuthTime
- Iftrue
theauth_Time
claim in the ID Token is required by default.
-
getDefaultACRs
Gets the default Authentication Context Class Reference (ACR) values. Corresponds to thedefault_acr_values
client metadata field.- Returns:
- The default ACR values, by order of preference,
null
if not specified.
-
setDefaultACRs
Sets the default Authentication Context Class Reference (ACR) values. Corresponds to thedefault_acr_values
client metadata field.- Parameters:
defaultACRs
- The default ACRs, by order of preference,null
if not specified.
-
getInitiateLoginURI
Gets the HTTPS URI that the authorisation server can call to initiate a login at the client. Corresponds to theinitiate_login_uri
client metadata field.- Returns:
- The login URI,
null
if not specified.
-
setInitiateLoginURI
Sets the HTTPS URI that the authorisation server can call to initiate a login at the client. Corresponds to theinitiate_login_uri
client metadata field.- Parameters:
loginURI
- The login URI,null
if not specified. The URI scheme must be https.
-
getPostLogoutRedirectionURIs
Gets the post logout redirection URIs. Corresponds to thepost_logout_redirect_uris
client metadata field.- Returns:
- The logout redirection URIs,
null
if not specified.
-
setPostLogoutRedirectionURIs
Sets the post logout redirection URIs. Corresponds to thepost_logout_redirect_uris
client metadata field.- Parameters:
logoutURIs
- The post logout redirection URIs,null
if not specified.
-
getFrontChannelLogoutURI
Gets the front-channel logout URI. Corresponds to thefrontchannel_logout_uri
client metadata field.- Returns:
- The front-channel logout URI,
null
if not specified.
-
setFrontChannelLogoutURI
Sets the front-channel logout URI. Corresponds to thefrontchannel_logout_uri
client metadata field.- Parameters:
frontChannelLogoutURI
- The front-channel logout URI,null
if not specified.
-
requiresFrontChannelLogoutSession
Gets the requirement for a session identifier on front-channel logout. Corresponds to thefrontchannel_logout_session_required
client metadata field.- Returns:
true
if a session identifier is required, elsefalse
.
-
requiresFrontChannelLogoutSession
Sets the requirement for a session identifier on front-channel logout. Corresponds to thefrontchannel_logout_session_required
client metadata field.- Parameters:
requiresSession
-true
if a session identifier is required, elsefalse
.
-
getBackChannelLogoutURI
Gets the back-channel logout URI. Corresponds to thebackchannel_logout_uri
client metadata field.- Returns:
- The back-channel logout URI,
null
if not specified.
-
setBackChannelLogoutURI
Sets the back-channel logout URI. Corresponds to thebackchannel_logout_uri
client metadata field.- Parameters:
backChannelLogoutURI
- The back-channel logout URI,null
if not specified. The URI scheme must be https or http.
-
requiresBackChannelLogoutSession
Gets the requirement for a session identifier on back-channel logout. Corresponds to thebackchannel_logout_session_required
client metadata field.- Returns:
true
if a session identifier is required, elsefalse
.
-
requiresBackChannelLogoutSession
Sets the requirement for a session identifier on back-channel logout. Corresponds to thebackchannel_logout_session_required
client metadata field.- Parameters:
requiresSession
-true
if a session identifier is required, elsefalse
.
-
getAttachmentDigestAlg
Gets the digest algorithm for the external evidence attachments in OpenID Connect for Identity Assurance 1.0. Corresponds to thedigest_algorithm
client metadata field.- Returns:
- The digest algorithm,
null
if not specified.
-
setAttachmentDigestAlg
Sets the digest algorithm for the external evidence attachments in OpenID Connect for Identity Assurance 1.0. Corresponds to thedigest_algorithm
client metadata field.- Parameters:
hashAlg
- The digest algorithm,null
if not specified.
-
applyDefaults
Applies the client metadata defaults where no values have been specified.- The response types default to
["code"]
. - The grant types default to
"authorization_code".
- The client authentication method defaults to "client_secret_basic".
- The application type defaults to
ApplicationType.WEB
. - The ID token JWS algorithm defaults to "RS256".
- Overrides:
applyDefaults
in classClientMetadata
- The response types default to
-
toJSONObject
Description copied from class:ClientMetadata
Returns the JSON object representation of this client metadata.- Overrides:
toJSONObject
in classClientMetadata
- Parameters:
includeCustomFields
-true
to include any custom metadata fields,false
to omit them.- Returns:
- The JSON object.
-
parse
public static OIDCClientMetadata parse(net.minidev.json.JSONObject jsonObject) throws ParseException Parses an OpenID Connect client metadata instance from the specified JSON object.- Parameters:
jsonObject
- The JSON object to parse. Must not benull
.- Returns:
- The OpenID Connect client metadata.
- Throws:
ParseException
- If the JSON object couldn't be parsed to an OpenID Connect client metadata instance.
-