Package com.nimbusds.oauth2.sdk.client
Class ClientMetadata
- java.lang.Object
-
- com.nimbusds.oauth2.sdk.client.ClientMetadata
-
- Direct Known Subclasses:
OIDCClientMetadata
public class ClientMetadata extends Object
Client metadata.Example client metadata, serialised to a JSON object:
{ "redirect_uris" : ["https://client.example.org/callback", "https://client.example.org/callback2"], "client_name" : "My Example Client", "client_name#ja-Jpan-JP" : "クライアント名", "token_endpoint_auth_method" : "client_secret_basic", "scope" : "read write dolphin", "logo_uri" : "https://client.example.org/logo.png", "jwks_uri" : "https://client.example.org/my_public_keys.jwks" }Related specifications:
- 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 ClientMetadata()Creates a new OAuth 2.0 client metadata instance.ClientMetadata(ClientMetadata metadata)Creates a shallow copy of the specified OAuth 2.0 client metadata instance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidapplyDefaults()Applies the client metadata defaults where no values have been specified.com.nimbusds.jose.JWEAlgorithmgetAuthorizationJWEAlg()Gets the JWE algorithm for JWT-encoded authorisation responses.com.nimbusds.jose.EncryptionMethodgetAuthorizationJWEEnc()Sets the encryption method for JWT-encoded authorisation responses.com.nimbusds.jose.JWSAlgorithmgetAuthorizationJWSAlg()Gets the JWS algorithm for JWT-encoded authorisation responses.List<javax.mail.internet.InternetAddress>getContacts()Deprecated.ObjectgetCustomField(String name)Gets the specified custom metadata field.net.minidev.json.JSONObjectgetCustomFields()Gets the custom metadata fields.List<String>getEmailContacts()Gets the administrator email contacts for the client.Set<GrantType>getGrantTypes()Gets the expected OAuth 2.0 grant types.com.nimbusds.jose.jwk.JWKSetgetJWKSet()Gets this client's JSON Web Key (JWK) set containing key(s) that are used in signing requests to the server and key(s) for encrypting responses.URIgetJWKSetURI()Gets the URI for this client's JSON Web Key (JWK) set containing key(s) that are used in signing requests to the server and key(s) for encrypting responses.URIgetLogoURI()Gets the client application logo.URIgetLogoURI(com.nimbusds.langtag.LangTag langTag)Gets the client application logo.Map<com.nimbusds.langtag.LangTag,URI>getLogoURIEntries()Gets the client application logo entries.booleangetMutualTLSSenderConstrainedAccessTokens()Deprecated.StringgetName()Gets the client name.StringgetName(com.nimbusds.langtag.LangTag langTag)Gets the client name.Map<com.nimbusds.langtag.LangTag,String>getNameEntries()Gets the client name entries.URIgetPolicyURI()Gets the client policy for use of end-user data.URIgetPolicyURI(com.nimbusds.langtag.LangTag langTag)Gets the client policy for use of end-user data.Map<com.nimbusds.langtag.LangTag,URI>getPolicyURIEntries()Gets the client policy entries for use of end-user data.URIgetRedirectionURI()Gets one of the redirection URIs for this client.Set<URI>getRedirectionURIs()Gets the redirection URIs for this client.Set<String>getRedirectionURIStrings()Gets the redirection URIs for this client as strings.static Set<String>getRegisteredParameterNames()Gets the registered (standard) OAuth 2.0 client metadata parameter names.com.nimbusds.jose.JWEAlgorithmgetRequestObjectJWEAlg()Gets the JSON Web Encryption (JWE) algorithm required for request objects sent by this client.com.nimbusds.jose.EncryptionMethodgetRequestObjectJWEEnc()Gets the JSON Web Encryption (JWE) method required for request objects sent by this client.com.nimbusds.jose.JWSAlgorithmgetRequestObjectJWSAlg()Gets the JSON Web Signature (JWS) algorithm required for request objects sent by this client.Set<URI>getRequestObjectURIs()Gets the pre-registered request object URIs.Set<ResponseType>getResponseTypes()Gets the expected OAuth 2.0 response types.ScopegetScope()Gets the scope values that the client can use when requesting access tokens.SoftwareIDgetSoftwareID()Gets the identifier for the OAuth 2.0 client software.SoftwareVersiongetSoftwareVersion()Gets the version identifier for the OAuth 2.0 client software.URIgetTermsOfServiceURI()Gets the client's terms of service.URIgetTermsOfServiceURI(com.nimbusds.langtag.LangTag langTag)Gets the client's terms of service.Map<com.nimbusds.langtag.LangTag,URI>getTermsOfServiceURIEntries()Gets the client's terms of service entries.StringgetTLSClientAuthSanDNS()Gets the expected dNSName SAN entry in the X.509 certificate, which the OAuth client will use in mutual TLS authentication.StringgetTLSClientAuthSanEmail()Gets the expected rfc822Name SAN entry in the X.509 certificate, which the OAuth client will use in mutual TLS authentication.StringgetTLSClientAuthSanIP()Gets the expected iPAddress SAN entry in the X.509 certificate, which the OAuth client will use in mutual TLS authentication.StringgetTLSClientAuthSanURI()Gets the expected uniformResourceIdentifier SAN entry in the X.509 certificate, which the OAuth client will use in mutual TLS authentication.StringgetTLSClientAuthSubjectDN()Gets the expected subject distinguished name (DN) of the client X.509 certificate in mutual TLS authentication.booleangetTLSClientCertificateBoundAccessTokens()Sets the preference for TLS client certificate bound access tokens.com.nimbusds.jose.JWSAlgorithmgetTokenEndpointAuthJWSAlg()Gets the JSON Web Signature (JWS) algorithm required forprivate_key_jwtandclient_secret_jwtauthentication at the Token endpoint.ClientAuthenticationMethodgetTokenEndpointAuthMethod()Gets the Token endpoint authentication method.URIgetURI()Gets the client home page.URIgetURI(com.nimbusds.langtag.LangTag langTag)Gets the client home page.Map<com.nimbusds.langtag.LangTag,URI>getURIEntries()Gets the client home page entries.booleanhasScopeValue(Scope.Value scopeValue)Checks if the scope matadata field is set and contains the specified scope value.static ClientMetadataparse(net.minidev.json.JSONObject jsonObject)Parses an client metadata instance from the specified JSON object.voidsetAuthorizationJWEAlg(com.nimbusds.jose.JWEAlgorithm authzJWEAlg)Sets the JWE algorithm for JWT-encoded authorisation responses.voidsetAuthorizationJWEEnc(com.nimbusds.jose.EncryptionMethod authzJWEEnc)Sets the encryption method for JWT-encoded authorisation responses.voidsetAuthorizationJWSAlg(com.nimbusds.jose.JWSAlgorithm authzJWSAlg)Sets the JWS algorithm for JWT-encoded authorisation responses.voidsetContacts(List<javax.mail.internet.InternetAddress> contacts)Deprecated.voidsetCustomField(String name, Object value)Sets the specified custom metadata field.voidsetCustomFields(net.minidev.json.JSONObject customFields)Sets the custom metadata fields.voidsetEmailContacts(List<String> contacts)Sets the administrator email contacts for the client.voidsetGrantTypes(Set<GrantType> grantTypes)Sets the expected OAuth 2.0 grant types.voidsetJWKSet(com.nimbusds.jose.jwk.JWKSet jwkSet)Sets this client's JSON Web Key (JWK) set containing key(s) that are used in signing requests to the server and key(s) for encrypting responses.voidsetJWKSetURI(URI jwkSetURI)Sets the URI for this client's JSON Web Key (JWK) set containing key(s) that are used in signing requests to the server and key(s) for encrypting responses.voidsetLogoURI(URI logoURI)Sets the client application logo.voidsetLogoURI(URI logoURI, com.nimbusds.langtag.LangTag langTag)Sets the client application logo.voidsetMutualTLSSenderConstrainedAccessTokens(boolean tlsSenderAccessTokens)Deprecated.voidsetName(String name)Sets the client name.voidsetName(String name, com.nimbusds.langtag.LangTag langTag)Sets the client name.voidsetPolicyURI(URI policyURI)Sets the client policy for use of end-user data.voidsetPolicyURI(URI policyURI, com.nimbusds.langtag.LangTag langTag)Sets the client policy for use of end-user data.voidsetRedirectionURI(URI redirectURI)Sets a single redirection URI for this client.voidsetRedirectionURIs(Set<URI> redirectURIs)Sets the redirection URIs for this client.voidsetRequestObjectJWEAlg(com.nimbusds.jose.JWEAlgorithm requestObjectJWEAlg)Sets the JSON Web Encryption (JWE) algorithm required for request objects sent by this client.voidsetRequestObjectJWEEnc(com.nimbusds.jose.EncryptionMethod requestObjectJWEEnc)Sets the JSON Web Encryption (JWE) method required for request objects sent by this client.voidsetRequestObjectJWSAlg(com.nimbusds.jose.JWSAlgorithm requestObjectJWSAlg)Sets the JSON Web Signature (JWS) algorithm required for request objects sent by this client.voidsetRequestObjectURIs(Set<URI> requestObjectURIs)Sets the pre-registered request object URIs.voidsetResponseTypes(Set<ResponseType> responseTypes)Sets the expected OAuth 2.0 response types.voidsetScope(Scope scope)Sets the scope values that the client can use when requesting access tokens.voidsetSoftwareID(SoftwareID softwareID)Sets the identifier for the OAuth 2.0 client software.voidsetSoftwareVersion(SoftwareVersion softwareVersion)Sets the version identifier for the OAuth 2.0 client software.voidsetTermsOfServiceURI(URI tosURI)Sets the client's terms of service.voidsetTermsOfServiceURI(URI tosURI, com.nimbusds.langtag.LangTag langTag)Sets the client's terms of service.voidsetTLSClientAuthSanDNS(String dns)Sets the expected dNSName SAN entry in the X.509 certificate, which the OAuth client will use in mutual TLS authentication.voidsetTLSClientAuthSanEmail(String email)Sets the expected rfc822Name SAN entry in the X.509 certificate, which the OAuth client will use in mutual TLS authentication.voidsetTLSClientAuthSanIP(String ip)Sets the expected iPAddress SAN entry in the X.509 certificate, which the OAuth client will use in mutual TLS authentication.voidsetTLSClientAuthSanURI(String uri)Sets the expected uniformResourceIdentifier SAN entry in the X.509 certificate, which the OAuth client will use in mutual TLS authentication.voidsetTLSClientAuthSubjectDN(String subjectDN)Sets the expected subject distinguished name (DN) of the client X.509 certificate in mutual TLS authentication.voidsetTLSClientCertificateBoundAccessTokens(boolean tlsClientCertBoundTokens)Gets the preference for TLS client certificate bound access tokens.voidsetTokenEndpointAuthJWSAlg(com.nimbusds.jose.JWSAlgorithm authJWSAlg)Sets the JSON Web Signature (JWS) algorithm required forprivate_key_jwtandclient_secret_jwtauthentication at the Token endpoint.voidsetTokenEndpointAuthMethod(ClientAuthenticationMethod authMethod)Sets the Token endpoint authentication method.voidsetURI(URI uri)Sets the client home page.voidsetURI(URI uri, com.nimbusds.langtag.LangTag langTag)Sets the client home page.net.minidev.json.JSONObjecttoJSONObject()Returns the JSON object representation of this client metadata, including any custom fields.net.minidev.json.JSONObjecttoJSONObject(boolean includeCustomFields)Returns the JSON object representation of this client metadata.StringtoString()
-
-
-
Constructor Detail
-
ClientMetadata
public ClientMetadata()
Creates a new OAuth 2.0 client metadata instance.
-
ClientMetadata
public ClientMetadata(ClientMetadata metadata)
Creates a shallow copy of the specified OAuth 2.0 client metadata instance.- Parameters:
metadata- The client metadata to copy. Must not benull.
-
-
Method Detail
-
getRegisteredParameterNames
public static Set<String> getRegisteredParameterNames()
Gets the registered (standard) OAuth 2.0 client metadata parameter names.- Returns:
- The registered parameter names, as an unmodifiable set.
-
getRedirectionURIs
public Set<URI> getRedirectionURIs()
Gets the redirection URIs for this client. Corresponds to theredirect_urisclient metadata field.- Returns:
- The redirection URIs,
nullif not specified.
-
getRedirectionURI
public URI getRedirectionURI()
Gets one of the redirection URIs for this client. Corresponds to theredirect_urisclient metadata field.- Returns:
- The redirection URI,
nullif not specified.
-
getRedirectionURIStrings
public Set<String> getRedirectionURIStrings()
Gets the redirection URIs for this client as strings. Corresponds to theredirect_urisclient metadata field.This short-hand method is intended to enable string-based URI comparison.
- Returns:
- The redirection URIs as strings,
nullif not specified.
-
setRedirectionURIs
public void setRedirectionURIs(Set<URI> redirectURIs)
Sets the redirection URIs for this client. Corresponds to theredirect_urisclient metadata field.- Parameters:
redirectURIs- The redirection URIs,nullif not specified. Valid redirection URIs must not contain a fragment.
-
setRedirectionURI
public void setRedirectionURI(URI redirectURI)
Sets a single redirection URI for this client. Corresponds to theredirect_urisclient metadata field.- Parameters:
redirectURI- The redirection URIs,nullif not specified. A valid redirection URI must not contain a fragment.
-
getScope
public Scope getScope()
Gets the scope values that the client can use when requesting access tokens. Corresponds to thescopeclient metadata field.- Returns:
- The scope,
nullif not specified.
-
hasScopeValue
public boolean hasScopeValue(Scope.Value scopeValue)
Checks if the scope matadata field is set and contains the specified scope value.- Parameters:
scopeValue- The scope value. Must not benull.- Returns:
trueif the scope value is contained, elsefalse.
-
setScope
public void setScope(Scope scope)
Sets the scope values that the client can use when requesting access tokens. Corresponds to thescopeclient metadata field.- Parameters:
scope- The scope,nullif not specified.
-
getResponseTypes
public Set<ResponseType> getResponseTypes()
Gets the expected OAuth 2.0 response types. Corresponds to theresponse_typesclient metadata field.- Returns:
- The response types,
nullif not specified.
-
setResponseTypes
public void setResponseTypes(Set<ResponseType> responseTypes)
Sets the expected OAuth 2.0 response types. Corresponds to theresponse_typesclient metadata field.- Parameters:
responseTypes- The response types,nullif not specified.
-
getGrantTypes
public Set<GrantType> getGrantTypes()
Gets the expected OAuth 2.0 grant types. Corresponds to thegrant_typesclient metadata field.- Returns:
- The grant types,
nullif not specified.
-
setGrantTypes
public void setGrantTypes(Set<GrantType> grantTypes)
Sets the expected OAuth 2.0 grant types. Corresponds to thegrant_typesclient metadata field.- Parameters:
grantTypes- The grant types,nullif not specified.
-
getContacts
@Deprecated public List<javax.mail.internet.InternetAddress> getContacts()
Deprecated.Gets the administrator email contacts for the client. Corresponds to thecontactsclient metadata field.Use
getEmailContacts()instead.- Returns:
- The administrator email contacts,
nullif not specified.
-
setContacts
@Deprecated public void setContacts(List<javax.mail.internet.InternetAddress> contacts)
Deprecated.Sets the administrator email contacts for the client. Corresponds to thecontactsclient metadata field.Use
setEmailContacts(List)instead.- Parameters:
contacts- The administrator email contacts,nullif not specified.
-
getEmailContacts
public List<String> getEmailContacts()
Gets the administrator email contacts for the client. Corresponds to thecontactsclient metadata field.- Returns:
- The administrator email contacts,
nullif not specified.
-
setEmailContacts
public void setEmailContacts(List<String> contacts)
Sets the administrator email contacts for the client. Corresponds to thecontactsclient metadata field.- Parameters:
contacts- The administrator email contacts,nullif not specified.
-
getName
public String getName()
Gets the client name. Corresponds to theclient_nameclient metadata field, with no language tag.- Returns:
- The client name,
nullif not specified.
-
getName
public String getName(com.nimbusds.langtag.LangTag langTag)
Gets the client name. Corresponds to theclient_nameclient metadata field, with an optional language tag.- Parameters:
langTag- The language tag of the entry,nullto get the non-tagged entry.- Returns:
- The client name,
nullif not specified.
-
getNameEntries
public Map<com.nimbusds.langtag.LangTag,String> getNameEntries()
Gets the client name entries. Corresponds to theclient_nameclient metadata field.- Returns:
- The client name entries, empty map if none.
-
setName
public void setName(String name)
Sets the client name. Corresponds to theclient_nameclient metadata field, with no language tag.- Parameters:
name- The client name,nullif not specified.
-
setName
public void setName(String name, com.nimbusds.langtag.LangTag langTag)
Sets the client name. Corresponds to theclient_nameclient metadata field, with an optional language tag.- Parameters:
name- The client name. Must not benull.langTag- The language tag,nullif not specified.
-
getLogoURI
public URI getLogoURI()
Gets the client application logo. Corresponds to thelogo_uriclient metadata field, with no language tag.- Returns:
- The logo URI,
nullif not specified.
-
getLogoURI
public URI getLogoURI(com.nimbusds.langtag.LangTag langTag)
Gets the client application logo. Corresponds to thelogo_uriclient metadata field, with an optional language tag.- Parameters:
langTag- The language tag,nullif not specified.- Returns:
- The logo URI,
nullif not specified.
-
getLogoURIEntries
public Map<com.nimbusds.langtag.LangTag,URI> getLogoURIEntries()
Gets the client application logo entries. Corresponds to thelogo_uriclient metadata field.- Returns:
- The logo URI entries, empty map if none.
-
setLogoURI
public void setLogoURI(URI logoURI)
Sets the client application logo. Corresponds to thelogo_uriclient metadata field, with no language tag.- Parameters:
logoURI- The logo URI,nullif not specified.
-
setLogoURI
public void setLogoURI(URI logoURI, com.nimbusds.langtag.LangTag langTag)
Sets the client application logo. Corresponds to thelogo_uriclient metadata field, with an optional language tag.- Parameters:
logoURI- The logo URI. Must not benull.langTag- The language tag,nullif not specified.
-
getURI
public URI getURI()
Gets the client home page. Corresponds to theclient_uriclient metadata field, with no language tag.- Returns:
- The client URI,
nullif not specified.
-
getURI
public URI getURI(com.nimbusds.langtag.LangTag langTag)
Gets the client home page. Corresponds to theclient_uriclient metadata field, with an optional language tag.- Parameters:
langTag- The language tag,nullif not specified.- Returns:
- The client URI,
nullif not specified.
-
getURIEntries
public Map<com.nimbusds.langtag.LangTag,URI> getURIEntries()
Gets the client home page entries. Corresponds to theclient_uriclient metadata field.- Returns:
- The client URI entries, empty map if none.
-
setURI
public void setURI(URI uri)
Sets the client home page. Corresponds to theclient_uriclient metadata field, with no language tag.- Parameters:
uri- The client URI,nullif not specified.
-
setURI
public void setURI(URI uri, com.nimbusds.langtag.LangTag langTag)
Sets the client home page. Corresponds to theclient_uriclient metadata field, with an optional language tag.- Parameters:
uri- The URI. Must not benull.langTag- The language tag,nullif not specified.
-
getPolicyURI
public URI getPolicyURI()
Gets the client policy for use of end-user data. Corresponds to thepolicy_uriclient metadata field, with no language tag.- Returns:
- The policy URI,
nullif not specified.
-
getPolicyURI
public URI getPolicyURI(com.nimbusds.langtag.LangTag langTag)
Gets the client policy for use of end-user data. Corresponds to thepolicy_uriclient metadata field, with an optional language tag.- Parameters:
langTag- The language tag,nullif not specified.- Returns:
- The policy URI,
nullif not specified.
-
getPolicyURIEntries
public Map<com.nimbusds.langtag.LangTag,URI> getPolicyURIEntries()
Gets the client policy entries for use of end-user data. Corresponds to thepolicy_uriclient metadata field.- Returns:
- The policy URI entries, empty map if none.
-
setPolicyURI
public void setPolicyURI(URI policyURI)
Sets the client policy for use of end-user data. Corresponds to thepolicy_uriclient metadata field, with no language tag.- Parameters:
policyURI- The policy URI,nullif not specified.
-
setPolicyURI
public void setPolicyURI(URI policyURI, com.nimbusds.langtag.LangTag langTag)
Sets the client policy for use of end-user data. Corresponds to thepolicy_uriclient metadata field, with an optional language tag.- Parameters:
policyURI- The policy URI. Must not benull.langTag- The language tag,nullif not specified.
-
getTermsOfServiceURI
public URI getTermsOfServiceURI()
Gets the client's terms of service. Corresponds to thetos_uriclient metadata field, with no language tag.- Returns:
- The terms of service URI,
nullif not specified.
-
getTermsOfServiceURI
public URI getTermsOfServiceURI(com.nimbusds.langtag.LangTag langTag)
Gets the client's terms of service. Corresponds to thetos_uriclient metadata field, with an optional language tag.- Parameters:
langTag- The language tag,nullif not specified.- Returns:
- The terms of service URI,
nullif not specified.
-
getTermsOfServiceURIEntries
public Map<com.nimbusds.langtag.LangTag,URI> getTermsOfServiceURIEntries()
Gets the client's terms of service entries. Corresponds to thetos_uriclient metadata field.- Returns:
- The terms of service URI entries, empty map if none.
-
setTermsOfServiceURI
public void setTermsOfServiceURI(URI tosURI)
Sets the client's terms of service. Corresponds to thetos_uriclient metadata field, with no language tag.- Parameters:
tosURI- The terms of service URI,nullif not specified.
-
setTermsOfServiceURI
public void setTermsOfServiceURI(URI tosURI, com.nimbusds.langtag.LangTag langTag)
Sets the client's terms of service. Corresponds to thetos_uriclient metadata field, with an optional language tag.- Parameters:
tosURI- The terms of service URI. Must not benull.langTag- The language tag,nullif not specified.
-
getTokenEndpointAuthMethod
public ClientAuthenticationMethod getTokenEndpointAuthMethod()
Gets the Token endpoint authentication method. Corresponds to thetoken_endpoint_auth_methodclient metadata field.- Returns:
- The Token endpoint authentication method,
nullif not specified.
-
setTokenEndpointAuthMethod
public void setTokenEndpointAuthMethod(ClientAuthenticationMethod authMethod)
Sets the Token endpoint authentication method. Corresponds to thetoken_endpoint_auth_methodclient metadata field.- Parameters:
authMethod- The Token endpoint authentication method,nullif not specified.
-
getTokenEndpointAuthJWSAlg
public com.nimbusds.jose.JWSAlgorithm getTokenEndpointAuthJWSAlg()
Gets the JSON Web Signature (JWS) algorithm required forprivate_key_jwtandclient_secret_jwtauthentication at the Token endpoint. Corresponds to thetoken_endpoint_auth_signing_algclient metadata field.- Returns:
- The JWS algorithm,
nullif not specified.
-
setTokenEndpointAuthJWSAlg
public void setTokenEndpointAuthJWSAlg(com.nimbusds.jose.JWSAlgorithm authJWSAlg)
Sets the JSON Web Signature (JWS) algorithm required forprivate_key_jwtandclient_secret_jwtauthentication at the Token endpoint. Corresponds to thetoken_endpoint_auth_signing_algclient metadata field.- Parameters:
authJWSAlg- The JWS algorithm,nullif not specified.
-
getJWKSetURI
public URI getJWKSetURI()
Gets the URI for this client's JSON Web Key (JWK) set containing key(s) that are used in signing requests to the server and key(s) for encrypting responses. Corresponds to thejwks_uriclient metadata field.- Returns:
- The JWK set URI,
nullif not specified.
-
setJWKSetURI
public void setJWKSetURI(URI jwkSetURI)
Sets the URI for this client's JSON Web Key (JWK) set containing key(s) that are used in signing requests to the server and key(s) for encrypting responses. Corresponds to thejwks_uriclient metadata field.- Parameters:
jwkSetURI- The JWK set URI,nullif not specified.
-
getJWKSet
public com.nimbusds.jose.jwk.JWKSet getJWKSet()
Gets this client's JSON Web Key (JWK) set containing key(s) that are used in signing requests to the server and key(s) for encrypting responses. Intended as an alternative togetJWKSetURI()for native clients. Corresponds to thejwksclient metadata field.- Returns:
- The JWK set,
nullif not specified.
-
setJWKSet
public void setJWKSet(com.nimbusds.jose.jwk.JWKSet jwkSet)
Sets this client's JSON Web Key (JWK) set containing key(s) that are used in signing requests to the server and key(s) for encrypting responses. Intended as an alternative togetJWKSetURI()for native clients. Corresponds to thejwksclient metadata field.- Parameters:
jwkSet- The JWK set,nullif not specified.
-
getRequestObjectURIs
public Set<URI> getRequestObjectURIs()
Gets the pre-registered request object URIs. Corresponds to therequest_urisclient metadata field.- Returns:
- The request object URIs,
nullif not specified.
-
setRequestObjectURIs
public void setRequestObjectURIs(Set<URI> requestObjectURIs)
Sets the pre-registered request object URIs. Corresponds to therequest_urisclient metadata field.- Parameters:
requestObjectURIs- The request object URIs,nullif not specified.
-
getRequestObjectJWSAlg
public com.nimbusds.jose.JWSAlgorithm getRequestObjectJWSAlg()
Gets the JSON Web Signature (JWS) algorithm required for request objects sent by this client. Corresponds to therequest_object_signing_algclient metadata field.- Returns:
- The JWS algorithm,
nullif not specified.
-
setRequestObjectJWSAlg
public void setRequestObjectJWSAlg(com.nimbusds.jose.JWSAlgorithm requestObjectJWSAlg)
Sets the JSON Web Signature (JWS) algorithm required for request objects sent by this client. Corresponds to therequest_object_signing_algclient metadata field.- Parameters:
requestObjectJWSAlg- The JWS algorithm,nullif not specified.
-
getRequestObjectJWEAlg
public com.nimbusds.jose.JWEAlgorithm getRequestObjectJWEAlg()
Gets the JSON Web Encryption (JWE) algorithm required for request objects sent by this client. Corresponds to therequest_object_encryption_algclient metadata field.- Returns:
- The JWE algorithm,
nullif not specified.
-
setRequestObjectJWEAlg
public void setRequestObjectJWEAlg(com.nimbusds.jose.JWEAlgorithm requestObjectJWEAlg)
Sets the JSON Web Encryption (JWE) algorithm required for request objects sent by this client. Corresponds to therequest_object_encryption_algclient metadata field.- Parameters:
requestObjectJWEAlg- The JWE algorithm,nullif not specified.
-
getRequestObjectJWEEnc
public com.nimbusds.jose.EncryptionMethod getRequestObjectJWEEnc()
Gets the JSON Web Encryption (JWE) method required for request objects sent by this client. Corresponds to therequest_object_encryption_encclient metadata field.- Returns:
- The JWE method,
nullif not specified.
-
setRequestObjectJWEEnc
public void setRequestObjectJWEEnc(com.nimbusds.jose.EncryptionMethod requestObjectJWEEnc)
Sets the JSON Web Encryption (JWE) method required for request objects sent by this client. Corresponds to therequest_object_encryption_encclient metadata field.- Parameters:
requestObjectJWEEnc- The JWE method,nullif not specified.
-
getSoftwareID
public SoftwareID getSoftwareID()
Gets the identifier for the OAuth 2.0 client software. Corresponds to thesoftware_idclient metadata field.- Returns:
- The software identifier,
nullif not specified.
-
setSoftwareID
public void setSoftwareID(SoftwareID softwareID)
Sets the identifier for the OAuth 2.0 client software. Corresponds to thesoftware_idclient metadata field.- Parameters:
softwareID- The software identifier,nullif not specified.
-
getSoftwareVersion
public SoftwareVersion getSoftwareVersion()
Gets the version identifier for the OAuth 2.0 client software. Corresponds to thesoftware_versionclient metadata field.- Returns:
- The version identifier,
nullif not specified.
-
setSoftwareVersion
public void setSoftwareVersion(SoftwareVersion softwareVersion)
Sets the version identifier for the OAuth 2.0 client software. Corresponds to thesoftware_versionclient metadata field.- Parameters:
softwareVersion- The version identifier,nullif not specified.
-
getTLSClientCertificateBoundAccessTokens
public boolean getTLSClientCertificateBoundAccessTokens()
Sets the preference for TLS client certificate bound access tokens. Corresponds to thetls_client_certificate_bound_access_tokensclient metadata field.- Returns:
trueindicates a preference for TLS client certificate bound access tokens,falseif none.
-
setTLSClientCertificateBoundAccessTokens
public void setTLSClientCertificateBoundAccessTokens(boolean tlsClientCertBoundTokens)
Gets the preference for TLS client certificate bound access tokens. Corresponds to thetls_client_certificate_bound_access_tokensclient metadata field.- Parameters:
tlsClientCertBoundTokens-trueindicates a preference for TLS client certificate bound access tokens,falseif none.
-
getMutualTLSSenderConstrainedAccessTokens
@Deprecated public boolean getMutualTLSSenderConstrainedAccessTokens()
Deprecated.Sets the preference for TLS client certificate bound access tokens. Corresponds to thetls_client_certificate_bound_access_tokensclient metadata field.- Returns:
trueindicates a preference for TLS client certificate bound access tokens,falseif none.
-
setMutualTLSSenderConstrainedAccessTokens
@Deprecated public void setMutualTLSSenderConstrainedAccessTokens(boolean tlsSenderAccessTokens)
Deprecated.Gets the preference for TLS client certificate bound access tokens. Corresponds to thetls_client_certificate_bound_access_tokensclient metadata field.- Parameters:
tlsSenderAccessTokens-trueindicates a preference for TLS client certificate bound access tokens,falseif none.
-
getTLSClientAuthSubjectDN
public String getTLSClientAuthSubjectDN()
Gets the expected subject distinguished name (DN) of the client X.509 certificate in mutual TLS authentication. Corresponds to thetls_client_auth_subject_dnclient metadata field.- Returns:
- The expected subject distinguished name (DN) of the client
X.509 certificate,
nullif not specified.
-
setTLSClientAuthSubjectDN
public void setTLSClientAuthSubjectDN(String subjectDN)
Sets the expected subject distinguished name (DN) of the client X.509 certificate in mutual TLS authentication. Corresponds to thetls_client_auth_subject_dnclient metadata field.- Parameters:
subjectDN- The expected subject distinguished name (DN) of the client X.509 certificate,nullif not specified.
-
getTLSClientAuthSanDNS
public String getTLSClientAuthSanDNS()
Gets the expected dNSName SAN entry in the X.509 certificate, which the OAuth client will use in mutual TLS authentication. Corresponds to thetls_client_auth_san_dnsclient metadata field.- Returns:
- The expected dNSName SAN entry in the X.509 certificate,
nullif not specified.
-
setTLSClientAuthSanDNS
public void setTLSClientAuthSanDNS(String dns)
Sets the expected dNSName SAN entry in the X.509 certificate, which the OAuth client will use in mutual TLS authentication. Corresponds to thetls_client_auth_san_dnsclient metadata field.- Parameters:
dns- The expected dNSName SAN entry in the X.509 certificate,nullif not specified.
-
getTLSClientAuthSanURI
public String getTLSClientAuthSanURI()
Gets the expected uniformResourceIdentifier SAN entry in the X.509 certificate, which the OAuth client will use in mutual TLS authentication. Corresponds to thetls_client_auth_san_uriclient metadata field.- Returns:
- The expected uniformResourceIdentifier SAN entry in the X.509
certificate,
nullif not specified.
-
setTLSClientAuthSanURI
public void setTLSClientAuthSanURI(String uri)
Sets the expected uniformResourceIdentifier SAN entry in the X.509 certificate, which the OAuth client will use in mutual TLS authentication. Corresponds to thetls_client_auth_san_uriclient metadata field.- Parameters:
uri- The expected uniformResourceIdentifier SAN entry in the X.509 certificate,nullif not specified.
-
getTLSClientAuthSanIP
public String getTLSClientAuthSanIP()
Gets the expected iPAddress SAN entry in the X.509 certificate, which the OAuth client will use in mutual TLS authentication. Corresponds to thetls_client_auth_san_ipclient metadata field.- Returns:
- The expected iPAddress SAN entry in the X.509 certificate,
nullif not specified.
-
setTLSClientAuthSanIP
public void setTLSClientAuthSanIP(String ip)
Sets the expected iPAddress SAN entry in the X.509 certificate, which the OAuth client will use in mutual TLS authentication. Corresponds to thetls_client_auth_san_ipclient metadata field.- Parameters:
ip- The expected iPAddress SAN entry in the X.509 certificate,nullif not specified.
-
getTLSClientAuthSanEmail
public String getTLSClientAuthSanEmail()
Gets the expected rfc822Name SAN entry in the X.509 certificate, which the OAuth client will use in mutual TLS authentication. Corresponds to thetls_client_auth_san_emailclient metadata field.- Returns:
- The expected rfc822Name SAN entry in the X.509 certificate,
nullif not specified.
-
setTLSClientAuthSanEmail
public void setTLSClientAuthSanEmail(String email)
Sets the expected rfc822Name SAN entry in the X.509 certificate, which the OAuth client will use in mutual TLS authentication. Corresponds to thetls_client_auth_san_emailclient metadata field.- Parameters:
email- The expected rfc822Name SAN entry in the X.509 certificate,nullif not specified.
-
getAuthorizationJWSAlg
public com.nimbusds.jose.JWSAlgorithm getAuthorizationJWSAlg()
Gets the JWS algorithm for JWT-encoded authorisation responses. Corresponds to theauthorization_signed_response_algclient metadata field.- Returns:
- The JWS algorithm,
nullif not specified.
-
setAuthorizationJWSAlg
public void setAuthorizationJWSAlg(com.nimbusds.jose.JWSAlgorithm authzJWSAlg)
Sets the JWS algorithm for JWT-encoded authorisation responses. Corresponds to theauthorization_signed_response_algclient metadata field.- Parameters:
authzJWSAlg- The JWS algorithm,nullif not specified. Must not be"none".
-
getAuthorizationJWEAlg
public com.nimbusds.jose.JWEAlgorithm getAuthorizationJWEAlg()
Gets the JWE algorithm for JWT-encoded authorisation responses. Corresponds to theauthorization_encrypted_response_algclient metadata field.- Returns:
- The JWE algorithm,
nullif not specified.
-
setAuthorizationJWEAlg
public void setAuthorizationJWEAlg(com.nimbusds.jose.JWEAlgorithm authzJWEAlg)
Sets the JWE algorithm for JWT-encoded authorisation responses. Corresponds to theauthorization_encrypted_response_algclient metadata field.- Parameters:
authzJWEAlg- The JWE algorithm,nullif not specified.
-
getAuthorizationJWEEnc
public com.nimbusds.jose.EncryptionMethod getAuthorizationJWEEnc()
Sets the encryption method for JWT-encoded authorisation responses. Corresponds to theauthorization_encrypted_response_encclient metadata field.- Returns:
- The encryption method,
nullif specified.
-
setAuthorizationJWEEnc
public void setAuthorizationJWEEnc(com.nimbusds.jose.EncryptionMethod authzJWEEnc)
Sets the encryption method for JWT-encoded authorisation responses. Corresponds to theauthorization_encrypted_response_encclient metadata field.- Parameters:
authzJWEEnc- The encryption method,nullif specified.
-
getCustomField
public Object getCustomField(String name)
Gets the specified custom metadata field.- Parameters:
name- The field name. Must not benull.- Returns:
- The field value, typically serialisable to a JSON entity,
nullif none.
-
getCustomFields
public net.minidev.json.JSONObject getCustomFields()
Gets the custom metadata fields.- Returns:
- The custom metadata fields, as a JSON object, empty object if none.
-
setCustomField
public void setCustomField(String name, Object value)
Sets the specified custom metadata field.- Parameters:
name- The field name. Must not benull.value- The field value. Should serialise to a JSON entity.
-
setCustomFields
public void setCustomFields(net.minidev.json.JSONObject customFields)
Sets the custom metadata fields.- Parameters:
customFields- The custom metadata fields, as a JSON object, empty object if none. Must not benull.
-
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", unless the grant type is "implicit" only.
- The encryption method for JWT-encoded authorisation
responses defaults to
A128CBC-HS256if a JWE algorithm is set.
- The response types default to
-
toJSONObject
public net.minidev.json.JSONObject toJSONObject()
Returns the JSON object representation of this client metadata, including any custom fields.- Returns:
- The JSON object.
-
toJSONObject
public net.minidev.json.JSONObject toJSONObject(boolean includeCustomFields)
Returns the JSON object representation of this client metadata.- Parameters:
includeCustomFields-trueto include any custom metadata fields,falseto omit them.- Returns:
- The JSON object.
-
parse
public static ClientMetadata parse(net.minidev.json.JSONObject jsonObject) throws ParseException
Parses an client metadata instance from the specified JSON object.- Parameters:
jsonObject- The JSON object to parse. Must not benull.- Returns:
- The client metadata.
- Throws:
ParseException- If the JSON object couldn't be parsed to a client metadata instance.
-
-