Class OIDCClientMetadata
- java.lang.Object
-
- com.nimbusds.oauth2.sdk.client.ClientMetadata
-
- com.nimbusds.openid.connect.sdk.rp.OIDCClientMetadata
-
public class OIDCClientMetadata extends ClientMetadata
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 04).
- OAuth 2.0 Dynamic Client Registration Protocol (RFC 7591), section 2.
- OAuth 2.0 Mutual TLS Client Authentication and Certificate Bound Access Tokens (draft-ietf-oauth-mtls-15), sections 2.1.2 and 3.4.
- Financial-grade API: JWT Secured Authorization Response Mode for OAuth 2.0 (JARM)
-
-
Constructor Summary
Constructors Constructor Description OIDCClientMetadata()Creates 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.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidapplyDefaults()Applies the client metadata defaults where no values have been specified.ApplicationTypegetApplicationType()Gets the client application type.URIgetBackChannelLogoutURI()Gets the back-channel logout URI.List<ACR>getDefaultACRs()Gets the default Authentication Context Class Reference (ACR) values.intgetDefaultMaxAge()Gets the default maximum authentication age.URIgetFrontChannelLogoutURI()Gets the front-channel logout URI.com.nimbusds.jose.JWEAlgorithmgetIDTokenJWEAlg()Gets the JSON Web Encryption (JWE) algorithm required for the ID Tokens issued to this client.com.nimbusds.jose.EncryptionMethodgetIDTokenJWEEnc()Gets the JSON Web Encryption (JWE) method required for the ID Tokens issued to this client.com.nimbusds.jose.JWSAlgorithmgetIDTokenJWSAlg()Gets the JSON Web Signature (JWS) algorithm required for the ID Tokens issued to this client.URIgetInitiateLoginURI()Gets the HTTPS URI that the authorisation server can call to initiate a login at the client.Set<URI>getPostLogoutRedirectionURIs()Gets the post logout redirection URIs.static Set<String>getRegisteredParameterNames()Gets the registered (standard) OpenID Connect client metadata parameter names.URIgetSectorIDURI()Gets the sector identifier URI.SubjectTypegetSubjectType()Gets the subject identifier type for responses to this client.com.nimbusds.jose.JWEAlgorithmgetUserInfoJWEAlg()Gets the JSON Web Encryption (JWE) algorithm required for the UserInfo responses to this client.com.nimbusds.jose.EncryptionMethodgetUserInfoJWEEnc()Gets the JSON Web Encryption (JWE) method required for the UserInfo responses to this client.com.nimbusds.jose.JWSAlgorithmgetUserInfoJWSAlg()Gets the JSON Web Signature (JWS) algorithm required for the UserInfo responses to this client.static OIDCClientMetadataparse(net.minidev.json.JSONObject jsonObject)Parses an OpenID Connect client metadata instance from the specified JSON object.booleanrequiresAuthTime()Gets the default requirement for theauth_timeclaim in the ID Token.voidrequiresAuthTime(boolean requiresAuthTime)Sets the default requirement for theauth_timeclaim in the ID Token.booleanrequiresBackChannelLogoutSession()Gets the requirement for a session identifier on back-channel logout.voidrequiresBackChannelLogoutSession(boolean requiresSession)Sets the requirement for a session identifier on back-channel logout.booleanrequiresFrontChannelLogoutSession()Gets the requirement for a session identifier on front-channel logout.voidrequiresFrontChannelLogoutSession(boolean requiresSession)Sets the requirement for a session identifier on front-channel logout.SectorIDresolveSectorID()Resolves the sector identifier from the client metadata.voidsetApplicationType(ApplicationType applicationType)Sets the client application type.voidsetBackChannelLogoutURI(URI backChannelLogoutURI)Sets the back-channel logout URI.voidsetDefaultACRs(List<ACR> defaultACRs)Sets the default Authentication Context Class Reference (ACR) values.voidsetDefaultMaxAge(int defaultMaxAge)Sets the default maximum authentication age.voidsetFrontChannelLogoutURI(URI frontChannelLogoutURI)Sets the front-channel logout URI.voidsetIDTokenJWEAlg(com.nimbusds.jose.JWEAlgorithm idTokenJWEAlg)Sets the JSON Web Encryption (JWE) algorithm required for the ID Tokens issued to this client.voidsetIDTokenJWEEnc(com.nimbusds.jose.EncryptionMethod idTokenJWEEnc)Sets the JSON Web Encryption (JWE) method required for the ID Tokens issued to this client.voidsetIDTokenJWSAlg(com.nimbusds.jose.JWSAlgorithm idTokenJWSAlg)Sets the JSON Web Signature (JWS) algorithm required for the ID Tokens issued to this client.voidsetInitiateLoginURI(URI loginURI)Sets the HTTPS URI that the authorisation server can call to initiate a login at the client.voidsetPostLogoutRedirectionURIs(Set<URI> logoutURIs)Sets the post logout redirection URIs.voidsetSectorIDURI(URI sectorIDURI)Sets the sector identifier URI.voidsetSubjectType(SubjectType subjectType)Sets the subject identifier type for responses to this client.voidsetUserInfoJWEAlg(com.nimbusds.jose.JWEAlgorithm userInfoJWEAlg)Sets the JSON Web Encryption (JWE) algorithm required for the UserInfo responses to this client.voidsetUserInfoJWEEnc(com.nimbusds.jose.EncryptionMethod userInfoJWEEnc)Sets the JSON Web Encryption (JWE) method required for the UserInfo responses to this client.voidsetUserInfoJWSAlg(com.nimbusds.jose.JWSAlgorithm userInfoJWSAlg)Sets the JSON Web Signature (JWS) algorithm required for the UserInfo responses to this client.net.minidev.json.JSONObjecttoJSONObject(boolean includeCustomFields)Returns the JSON object representation of this client metadata.-
Methods inherited from class com.nimbusds.oauth2.sdk.client.ClientMetadata
getAuthorizationJWEAlg, getAuthorizationJWEEnc, getAuthorizationJWSAlg, getContacts, getCustomField, getCustomFields, getEmailContacts, getGrantTypes, getJWKSet, getJWKSetURI, getLogoURI, getLogoURI, getLogoURIEntries, getMutualTLSSenderConstrainedAccessTokens, getName, getName, getNameEntries, getPolicyURI, getPolicyURI, getPolicyURIEntries, getRedirectionURI, getRedirectionURIs, getRedirectionURIStrings, getRequestObjectJWEAlg, getRequestObjectJWEEnc, getRequestObjectJWSAlg, getRequestObjectURIs, getResponseTypes, getScope, getSoftwareID, getSoftwareVersion, getTermsOfServiceURI, getTermsOfServiceURI, getTermsOfServiceURIEntries, getTLSClientAuthSanDNS, getTLSClientAuthSanEmail, getTLSClientAuthSanIP, getTLSClientAuthSanURI, getTLSClientAuthSubjectDN, getTLSClientCertificateBoundAccessTokens, getTokenEndpointAuthJWSAlg, getTokenEndpointAuthMethod, getURI, getURI, getURIEntries, hasScopeValue, setAuthorizationJWEAlg, setAuthorizationJWEEnc, setAuthorizationJWSAlg, setContacts, setCustomField, setCustomFields, setEmailContacts, setGrantTypes, setJWKSet, setJWKSetURI, setLogoURI, setLogoURI, setMutualTLSSenderConstrainedAccessTokens, setName, setName, setPolicyURI, setPolicyURI, setRedirectionURI, setRedirectionURIs, setRequestObjectJWEAlg, setRequestObjectJWEEnc, setRequestObjectJWSAlg, setRequestObjectURIs, setResponseTypes, setScope, setSoftwareID, setSoftwareVersion, setTermsOfServiceURI, setTermsOfServiceURI, setTLSClientAuthSanDNS, setTLSClientAuthSanEmail, setTLSClientAuthSanIP, setTLSClientAuthSanURI, setTLSClientAuthSubjectDN, setTLSClientCertificateBoundAccessTokens, setTokenEndpointAuthJWSAlg, setTokenEndpointAuthMethod, setURI, setURI, toJSONObject, toString
-
-
-
-
Constructor Detail
-
OIDCClientMetadata
public OIDCClientMetadata()
Creates a new OpenID Connect client metadata instance.
-
OIDCClientMetadata
public OIDCClientMetadata(ClientMetadata metadata)
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.
-
-
Method Detail
-
getRegisteredParameterNames
public static Set<String> getRegisteredParameterNames()
Gets the registered (standard) OpenID Connect client metadata parameter names.- Returns:
- The registered OpenID Connect parameter names, as an unmodifiable set.
-
getApplicationType
public ApplicationType getApplicationType()
Gets the client application type. Corresponds to theapplication_typeclient metadata field.- Returns:
- The client application type,
nullif not specified.
-
setApplicationType
public void setApplicationType(ApplicationType applicationType)
Sets the client application type. Corresponds to theapplication_typeclient metadata field.- Parameters:
applicationType- The client application type,nullif not specified.
-
getSubjectType
public SubjectType getSubjectType()
Gets the subject identifier type for responses to this client. Corresponds to thesubject_typeclient metadata field.- Returns:
- The subject identifier type,
nullif not specified.
-
setSubjectType
public void setSubjectType(SubjectType subjectType)
Sets the subject identifier type for responses to this client. Corresponds to thesubject_typeclient metadata field.- Parameters:
subjectType- The subject identifier type,nullif not specified.
-
getSectorIDURI
public URI getSectorIDURI()
Gets the sector identifier URI. Corresponds to thesector_identifier_uriclient metadata field.- Returns:
- The sector identifier URI,
nullif not specified.
-
setSectorIDURI
public void setSectorIDURI(URI sectorIDURI)
Sets the sector identifier URI. Corresponds to thesector_identifier_uriclient metadata field.- Parameters:
sectorIDURI- The sector identifier URI,nullif not specified.
-
resolveSectorID
public SectorID resolveSectorID()
Resolves the sector identifier from the client metadata.- Returns:
- The sector identifier,
nullif the subject type is set to public. - Throws:
IllegalStateException- If resolution failed due to incomplete or inconsistent metadata.
-
getIDTokenJWSAlg
public com.nimbusds.jose.JWSAlgorithm getIDTokenJWSAlg()
Gets the JSON Web Signature (JWS) algorithm required for the ID Tokens issued to this client. Corresponds to theid_token_signed_response_algclient metadata field.- Returns:
- The JWS algorithm,
nullif not specified.
-
setIDTokenJWSAlg
public void setIDTokenJWSAlg(com.nimbusds.jose.JWSAlgorithm idTokenJWSAlg)
Sets the JSON Web Signature (JWS) algorithm required for the ID Tokens issued to this client. Corresponds to theid_token_signed_response_algclient metadata field.- Parameters:
idTokenJWSAlg- The JWS algorithm,nullif not specified.
-
getIDTokenJWEAlg
public com.nimbusds.jose.JWEAlgorithm getIDTokenJWEAlg()
Gets the JSON Web Encryption (JWE) algorithm required for the ID Tokens issued to this client. Corresponds to theid_token_encrypted_response_algclient metadata field.- Returns:
- The JWE algorithm,
nullif not specified.
-
setIDTokenJWEAlg
public void setIDTokenJWEAlg(com.nimbusds.jose.JWEAlgorithm idTokenJWEAlg)
Sets the JSON Web Encryption (JWE) algorithm required for the ID Tokens issued to this client. Corresponds to theid_token_encrypted_response_algclient metadata field.- Parameters:
idTokenJWEAlg- The JWE algorithm,nullif not specified.
-
getIDTokenJWEEnc
public com.nimbusds.jose.EncryptionMethod getIDTokenJWEEnc()
Gets the JSON Web Encryption (JWE) method required for the ID Tokens issued to this client. Corresponds to theid_token_encrypted_response_encclient metadata field.- Returns:
- The JWE method,
nullif not specified.
-
setIDTokenJWEEnc
public void setIDTokenJWEEnc(com.nimbusds.jose.EncryptionMethod idTokenJWEEnc)
Sets the JSON Web Encryption (JWE) method required for the ID Tokens issued to this client. Corresponds to theid_token_encrypted_response_encclient metadata field.- Parameters:
idTokenJWEEnc- The JWE method,nullif not specified.
-
getUserInfoJWSAlg
public com.nimbusds.jose.JWSAlgorithm getUserInfoJWSAlg()
Gets the JSON Web Signature (JWS) algorithm required for the UserInfo responses to this client. Corresponds to theuserinfo_signed_response_algclient metadata field.- Returns:
- The JWS algorithm,
nullif not specified.
-
setUserInfoJWSAlg
public void setUserInfoJWSAlg(com.nimbusds.jose.JWSAlgorithm userInfoJWSAlg)
Sets the JSON Web Signature (JWS) algorithm required for the UserInfo responses to this client. Corresponds to theuserinfo_signed_response_algclient metadata field.- Parameters:
userInfoJWSAlg- The JWS algorithm,nullif not specified.
-
getUserInfoJWEAlg
public com.nimbusds.jose.JWEAlgorithm getUserInfoJWEAlg()
Gets the JSON Web Encryption (JWE) algorithm required for the UserInfo responses to this client. Corresponds to theuserinfo_encrypted_response_algclient metadata field.- Returns:
- The JWE algorithm,
nullif not specified.
-
setUserInfoJWEAlg
public void setUserInfoJWEAlg(com.nimbusds.jose.JWEAlgorithm userInfoJWEAlg)
Sets the JSON Web Encryption (JWE) algorithm required for the UserInfo responses to this client. Corresponds to theuserinfo_encrypted_response_algclient metadata field.- Parameters:
userInfoJWEAlg- The JWE algorithm,nullif not specified.
-
getUserInfoJWEEnc
public com.nimbusds.jose.EncryptionMethod getUserInfoJWEEnc()
Gets the JSON Web Encryption (JWE) method required for the UserInfo responses to this client. Corresponds to theuserinfo_encrypted_response_encclient metadata field.- Returns:
- The JWE method,
nullif not specified.
-
setUserInfoJWEEnc
public void setUserInfoJWEEnc(com.nimbusds.jose.EncryptionMethod userInfoJWEEnc)
Sets the JSON Web Encryption (JWE) method required for the UserInfo responses to this client. Corresponds to theuserinfo_encrypted_response_encclient metadata field.- Parameters:
userInfoJWEEnc- The JWE method,nullif not specified.
-
getDefaultMaxAge
public int getDefaultMaxAge()
Gets the default maximum authentication age. Corresponds to thedefault_max_ageclient metadata field.- Returns:
- The default max authentication age, in seconds. If not specified -1.
-
setDefaultMaxAge
public void setDefaultMaxAge(int defaultMaxAge)
Sets the default maximum authentication age. Corresponds to thedefault_max_ageclient metadata field.- Parameters:
defaultMaxAge- The default max authentication age, in seconds. If not specified -1.
-
requiresAuthTime
public boolean requiresAuthTime()
Gets the default requirement for theauth_timeclaim in the ID Token. Corresponds to therequire_auth_timeclient metadata field.- Returns:
- If
truetheauth_Timeclaim in the ID Token is required by default.
-
requiresAuthTime
public void requiresAuthTime(boolean requiresAuthTime)
Sets the default requirement for theauth_timeclaim in the ID Token. Corresponds to therequire_auth_timeclient metadata field.- Parameters:
requiresAuthTime- Iftruetheauth_Timeclaim in the ID Token is required by default.
-
getDefaultACRs
public List<ACR> getDefaultACRs()
Gets the default Authentication Context Class Reference (ACR) values. Corresponds to thedefault_acr_valuesclient metadata field.- Returns:
- The default ACR values, by order of preference,
nullif not specified.
-
setDefaultACRs
public void setDefaultACRs(List<ACR> defaultACRs)
Sets the default Authentication Context Class Reference (ACR) values. Corresponds to thedefault_acr_valuesclient metadata field.- Parameters:
defaultACRs- The default ACRs, by order of preference,nullif not specified.
-
getInitiateLoginURI
public URI getInitiateLoginURI()
Gets the HTTPS URI that the authorisation server can call to initiate a login at the client. Corresponds to theinitiate_login_uriclient metadata field.- Returns:
- The login URI,
nullif not specified.
-
setInitiateLoginURI
public void setInitiateLoginURI(URI loginURI)
Sets the HTTPS URI that the authorisation server can call to initiate a login at the client. Corresponds to theinitiate_login_uriclient metadata field.- Parameters:
loginURI- The login URI,nullif not specified.
-
getPostLogoutRedirectionURIs
public Set<URI> getPostLogoutRedirectionURIs()
Gets the post logout redirection URIs. Corresponds to thepost_logout_redirect_urisclient metadata field.- Returns:
- The logout redirection URIs,
nullif not specified.
-
setPostLogoutRedirectionURIs
public void setPostLogoutRedirectionURIs(Set<URI> logoutURIs)
Sets the post logout redirection URIs. Corresponds to thepost_logout_redirect_urisclient metadata field.- Parameters:
logoutURIs- The logout redirection URIs,nullif not specified.
-
getFrontChannelLogoutURI
public URI getFrontChannelLogoutURI()
Gets the front-channel logout URI. Corresponds to thefrontchannel_logout_uriclient metadata field.- Returns:
- The front-channel logout URI,
nullif not specified.
-
setFrontChannelLogoutURI
public void setFrontChannelLogoutURI(URI frontChannelLogoutURI)
Sets the front-channel logout URI. Corresponds to thefrontchannel_logout_uriclient metadata field.- Parameters:
frontChannelLogoutURI- The front-channel logout URI,nullif not specified.
-
requiresFrontChannelLogoutSession
public boolean requiresFrontChannelLogoutSession()
Gets the requirement for a session identifier on front-channel logout. Corresponds to thefrontchannel_logout_session_requiredclient metadata field.- Returns:
trueif a session identifier is required, elsefalse.
-
requiresFrontChannelLogoutSession
public void requiresFrontChannelLogoutSession(boolean requiresSession)
Sets the requirement for a session identifier on front-channel logout. Corresponds to thefrontchannel_logout_session_requiredclient metadata field.- Parameters:
requiresSession-trueif a session identifier is required, elsefalse.
-
getBackChannelLogoutURI
public URI getBackChannelLogoutURI()
Gets the back-channel logout URI. Corresponds to thebackchannel_logout_uriclient metadata field.- Returns:
- The back-channel logout URI,
nullif not specified.
-
setBackChannelLogoutURI
public void setBackChannelLogoutURI(URI backChannelLogoutURI)
Sets the back-channel logout URI. Corresponds to thebackchannel_logout_uriclient metadata field.- Parameters:
backChannelLogoutURI- The back-channel logout URI,nullif not specified.
-
requiresBackChannelLogoutSession
public boolean requiresBackChannelLogoutSession()
Gets the requirement for a session identifier on back-channel logout. Corresponds to thebackchannel_logout_session_requiredclient metadata field.- Returns:
trueif a session identifier is required, elsefalse.
-
requiresBackChannelLogoutSession
public void requiresBackChannelLogoutSession(boolean requiresSession)
Sets the requirement for a session identifier on back-channel logout. Corresponds to thebackchannel_logout_session_requiredclient metadata field.- Parameters:
requiresSession-trueif a session identifier is required, elsefalse.
-
applyDefaults
public void 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:
applyDefaultsin classClientMetadata
- The response types default to
-
toJSONObject
public net.minidev.json.JSONObject toJSONObject(boolean includeCustomFields)
Description copied from class:ClientMetadataReturns the JSON object representation of this client metadata.- Overrides:
toJSONObjectin classClientMetadata- Parameters:
includeCustomFields-trueto include any custom metadata fields,falseto 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.
-
-