public class ClientMetadata extends Object
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:
Constructor and 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.
|
Modifier and Type | Method and Description |
---|---|
void |
applyDefaults()
Applies the client metadata defaults where no values have been
specified.
|
List<javax.mail.internet.InternetAddress> |
getContacts()
Deprecated.
|
Object |
getCustomField(String name)
Gets the specified custom metadata field.
|
net.minidev.json.JSONObject |
getCustomFields()
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.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.
|
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.
|
URI |
getLogoURI()
Gets the client application logo.
|
URI |
getLogoURI(com.nimbusds.langtag.LangTag langTag)
Gets the client application logo.
|
Map<com.nimbusds.langtag.LangTag,URI> |
getLogoURIEntries()
Gets the client application logo entries.
|
boolean |
getMutualTLSSenderConstrainedAccessTokens()
Deprecated.
|
String |
getName()
Gets the client name.
|
String |
getName(com.nimbusds.langtag.LangTag langTag)
Gets the client name.
|
Map<com.nimbusds.langtag.LangTag,String> |
getNameEntries()
Gets the client name entries.
|
URI |
getPolicyURI()
Gets the client policy for use of end-user data.
|
URI |
getPolicyURI(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.
|
URI |
getRedirectionURI()
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.
|
Set<ResponseType> |
getResponseTypes()
Gets the expected OAuth 2.0 response types.
|
Scope |
getScope()
Gets the scope values that the client can use when requesting access
tokens.
|
SoftwareID |
getSoftwareID()
Gets the identifier for the OAuth 2.0 client software.
|
SoftwareVersion |
getSoftwareVersion()
Gets the version identifier for the OAuth 2.0 client software.
|
URI |
getTermsOfServiceURI()
Gets the client's terms of service.
|
URI |
getTermsOfServiceURI(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.
|
String |
getTLSClientAuthSubjectDN()
Gets the expected subject distinguished name (DN) of the client
X.509 certificate in mutual TLS authentication.
|
boolean |
getTLSClientCertificateBoundAccessTokens()
Sets the preference for TLS client certificate bound access tokens.
|
com.nimbusds.jose.JWSAlgorithm |
getTokenEndpointAuthJWSAlg()
Gets the JSON Web Signature (JWS) algorithm required for
private_key_jwt and client_secret_jwt
authentication at the Token endpoint. |
ClientAuthenticationMethod |
getTokenEndpointAuthMethod()
Gets the Token endpoint authentication method.
|
URI |
getURI()
Gets the client home page.
|
URI |
getURI(com.nimbusds.langtag.LangTag langTag)
Gets the client home page.
|
Map<com.nimbusds.langtag.LangTag,URI> |
getURIEntries()
Gets the client home page entries.
|
boolean |
hasScopeValue(Scope.Value scopeValue)
Checks if the scope matadata field is set and contains the specified
scope value.
|
static ClientMetadata |
parse(net.minidev.json.JSONObject jsonObject)
Parses an client metadata instance from the specified JSON object.
|
void |
setContacts(List<javax.mail.internet.InternetAddress> contacts)
Deprecated.
|
void |
setCustomField(String name,
Object value)
Sets the specified custom metadata field.
|
void |
setCustomFields(net.minidev.json.JSONObject customFields)
Sets the custom metadata fields.
|
void |
setEmailContacts(List<String> contacts)
Sets the administrator email contacts for the client.
|
void |
setGrantTypes(Set<GrantType> grantTypes)
Sets the expected OAuth 2.0 grant types.
|
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.
|
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.
|
void |
setLogoURI(URI logoURI)
Sets the client application logo.
|
void |
setLogoURI(URI logoURI,
com.nimbusds.langtag.LangTag langTag)
Sets the client application logo.
|
void |
setMutualTLSSenderConstrainedAccessTokens(boolean tlsSenderAccessTokens)
Deprecated.
|
void |
setName(String name)
Sets the client name.
|
void |
setName(String name,
com.nimbusds.langtag.LangTag langTag)
Sets the client name.
|
void |
setPolicyURI(URI policyURI)
Sets the client policy for use of end-user data.
|
void |
setPolicyURI(URI policyURI,
com.nimbusds.langtag.LangTag langTag)
Sets the client policy for use of end-user data.
|
void |
setRedirectionURI(URI redirectURI)
Sets a single redirection URI for this client.
|
void |
setRedirectionURIs(Set<URI> redirectURIs)
Sets the redirection URIs for this client.
|
void |
setResponseTypes(Set<ResponseType> responseTypes)
Sets the expected OAuth 2.0 response types.
|
void |
setScope(Scope scope)
Sets the scope values that the client can use when requesting access
tokens.
|
void |
setSoftwareID(SoftwareID softwareID)
Sets the identifier for the OAuth 2.0 client software.
|
void |
setSoftwareVersion(SoftwareVersion softwareVersion)
Sets the version identifier for the OAuth 2.0 client software.
|
void |
setTermsOfServiceURI(URI tosURI)
Sets the client's terms of service.
|
void |
setTermsOfServiceURI(URI tosURI,
com.nimbusds.langtag.LangTag langTag)
Sets the client's terms of service.
|
void |
setTLSClientAuthSubjectDN(String subjectDN)
Sets the expected subject distinguished name (DN) of the client
X.509 certificate in mutual TLS authentication.
|
void |
setTLSClientCertificateBoundAccessTokens(boolean tlsClientCertBoundTokens)
Gets the preference for TLS client certificate bound access tokens.
|
void |
setTokenEndpointAuthJWSAlg(com.nimbusds.jose.JWSAlgorithm authJWSAlg)
Sets the JSON Web Signature (JWS) algorithm required for
private_key_jwt and client_secret_jwt
authentication at the Token endpoint. |
void |
setTokenEndpointAuthMethod(ClientAuthenticationMethod authMethod)
Sets the Token endpoint authentication method.
|
void |
setURI(URI uri)
Sets the client home page.
|
void |
setURI(URI uri,
com.nimbusds.langtag.LangTag langTag)
Sets the client home page.
|
net.minidev.json.JSONObject |
toJSONObject()
Returns the JSON object representation of this client metadata,
including any custom fields.
|
net.minidev.json.JSONObject |
toJSONObject(boolean includeCustomFields)
Returns the JSON object representation of this client metadata.
|
String |
toString() |
public ClientMetadata()
public ClientMetadata(ClientMetadata metadata)
metadata
- The client metadata to copy. Must not be
null
.public static Set<String> getRegisteredParameterNames()
public Set<URI> getRedirectionURIs()
redirect_uris
client metadata field.null
if not specified.public URI getRedirectionURI()
redirect_uris
client metadata field.null
if not specified.public Set<String> getRedirectionURIStrings()
redirect_uris
client metadata field.
This short-hand method is intended to enable string-based URI comparison.
null
if not
specified.public void setRedirectionURIs(Set<URI> redirectURIs)
redirect_uris
client metadata field.redirectURIs
- The redirection URIs, null
if not
specified. Valid redirection URIs must not
contain a fragment.public void setRedirectionURI(URI redirectURI)
redirect_uris
client metadata field.redirectURI
- The redirection URIs, null
if not
specified. A valid redirection URI must not
contain a fragment.public Scope getScope()
scope
client metadata field.null
if not specified.public boolean hasScopeValue(Scope.Value scopeValue)
scopeValue
- The scope value. Must not be null
.true
if the scope value is contained, else
false
.public void setScope(Scope scope)
scope
client metadata field.scope
- The scope, null
if not specified.public Set<ResponseType> getResponseTypes()
response_types
client metadata field.null
if not specified.public void setResponseTypes(Set<ResponseType> responseTypes)
response_types
client metadata field.responseTypes
- The response types, null
if not
specified.public Set<GrantType> getGrantTypes()
grant_types
client metadata field.null
if not specified.public void setGrantTypes(Set<GrantType> grantTypes)
grant_types
client metadata field.grantTypes
- The grant types, null
if not specified.@Deprecated public List<javax.mail.internet.InternetAddress> getContacts()
contacts
client metadata field.
Use getEmailContacts()
instead.
null
if not
specified.@Deprecated public void setContacts(List<javax.mail.internet.InternetAddress> contacts)
contacts
client metadata field.
Use setEmailContacts(List)
instead.
contacts
- The administrator email contacts, null
if
not specified.public List<String> getEmailContacts()
contacts
client metadata field.null
if not
specified.public void setEmailContacts(List<String> contacts)
contacts
client metadata field.contacts
- The administrator email contacts, null
if
not specified.public String getName()
client_name
client
metadata field, with no language tag.null
if not specified.public String getName(com.nimbusds.langtag.LangTag langTag)
client_name
client
metadata field, with an optional language tag.langTag
- The language tag of the entry, null
to get
the non-tagged entry.null
if not specified.public Map<com.nimbusds.langtag.LangTag,String> getNameEntries()
client_name
client metadata field.public void setName(String name)
client_name
client
metadata field, with no language tag.name
- The client name, null
if not specified.public void setName(String name, com.nimbusds.langtag.LangTag langTag)
client_name
client
metadata field, with an optional language tag.name
- The client name. Must not be null
.langTag
- The language tag, null
if not specified.public URI getLogoURI()
logo_uri
client metadata field, with no language
tag.null
if not specified.public URI getLogoURI(com.nimbusds.langtag.LangTag langTag)
logo_uri
client metadata field, with an optional
language tag.null
if not specified.public Map<com.nimbusds.langtag.LangTag,URI> getLogoURIEntries()
logo_uri
client metadata field.public void setLogoURI(URI logoURI)
logo_uri
client metadata field, with no language
tag.logoURI
- The logo URI, null
if not specified.public void setLogoURI(URI logoURI, com.nimbusds.langtag.LangTag langTag)
logo_uri
client metadata field, with an optional
language tag.logoURI
- The logo URI. Must not be null
.langTag
- The language tag, null
if not specified.public URI getURI()
client_uri
client metadata field, with no language tag.null
if not specified.public URI getURI(com.nimbusds.langtag.LangTag langTag)
client_uri
client metadata field, with an optional language tag.null
if not specified.public Map<com.nimbusds.langtag.LangTag,URI> getURIEntries()
client_uri
client metadata field.public void setURI(URI uri)
client_uri
client metadata field, with no language tag.uri
- The client URI, null
if not specified.public void setURI(URI uri, com.nimbusds.langtag.LangTag langTag)
client_uri
client metadata field, with an optional language tag.uri
- The URI. Must not be null
.langTag
- The language tag, null
if not specified.public URI getPolicyURI()
policy_uri
client metadata field, with no language
tag.null
if not specified.public URI getPolicyURI(com.nimbusds.langtag.LangTag langTag)
policy_uri
client metadata field, with an optional
language tag.null
if not specified.public Map<com.nimbusds.langtag.LangTag,URI> getPolicyURIEntries()
policy_uri
client metadata field.public void setPolicyURI(URI policyURI)
policy_uri
client metadata field, with no language
tag.policyURI
- The policy URI, null
if not specified.public void setPolicyURI(URI policyURI, com.nimbusds.langtag.LangTag langTag)
policy_uri
client metadata field, with an optional
language tag.policyURI
- The policy URI. Must not be null
.langTag
- The language tag, null
if not specified.public URI getTermsOfServiceURI()
tos_uri
client metadata field, with no language
tag.null
if not specified.public URI getTermsOfServiceURI(com.nimbusds.langtag.LangTag langTag)
tos_uri
client metadata field, with an optional
language tag.null
if not specified.public Map<com.nimbusds.langtag.LangTag,URI> getTermsOfServiceURIEntries()
tos_uri
client metadata field.public void setTermsOfServiceURI(URI tosURI)
tos_uri
client metadata field, with no language
tag.tosURI
- The terms of service URI, null
if not
specified.public void setTermsOfServiceURI(URI tosURI, com.nimbusds.langtag.LangTag langTag)
tos_uri
client metadata field, with an optional
language tag.tosURI
- The terms of service URI. Must not be null
.langTag
- The language tag, null
if not specified.public ClientAuthenticationMethod getTokenEndpointAuthMethod()
token_endpoint_auth_method
client metadata field.null
if
not specified.public void setTokenEndpointAuthMethod(ClientAuthenticationMethod authMethod)
token_endpoint_auth_method
client metadata field.authMethod
- The Token endpoint authentication method,
null
if not specified.public com.nimbusds.jose.JWSAlgorithm getTokenEndpointAuthJWSAlg()
private_key_jwt
and client_secret_jwt
authentication at the Token endpoint. Corresponds to the
token_endpoint_auth_signing_alg
client metadata field.null
if not specified.public void setTokenEndpointAuthJWSAlg(com.nimbusds.jose.JWSAlgorithm authJWSAlg)
private_key_jwt
and client_secret_jwt
authentication at the Token endpoint. Corresponds to the
token_endpoint_auth_signing_alg
client metadata field.authJWSAlg
- The JWS algorithm, null
if not specified.public URI getJWKSetURI()
jwks_uri
client
metadata field.null
if not specified.public void setJWKSetURI(URI jwkSetURI)
jwks_uri
client
metadata field.jwkSetURI
- The JWK set URI, null
if not specified.public com.nimbusds.jose.jwk.JWKSet getJWKSet()
getJWKSetURI()
for
native clients. Corresponds to the jwks
client metadata
field.null
if not specified.public void setJWKSet(com.nimbusds.jose.jwk.JWKSet jwkSet)
getJWKSetURI()
for
native clients. Corresponds to the jwks
client metadata
field.jwkSet
- The JWK set, null
if not specified.public SoftwareID getSoftwareID()
software_id
client metadata field.null
if not specified.public void setSoftwareID(SoftwareID softwareID)
software_id
client metadata field.softwareID
- The software identifier, null
if not
specified.public SoftwareVersion getSoftwareVersion()
software_version
client metadata field.null
if not specified.public void setSoftwareVersion(SoftwareVersion softwareVersion)
software_version
client metadata field.softwareVersion
- The version identifier, null
if not
specified.public boolean getTLSClientCertificateBoundAccessTokens()
tls_client_certificate_bound_access_tokens
client metadata
field.true
indicates a preference for TLS client
certificate bound access tokens, false
if none.public void setTLSClientCertificateBoundAccessTokens(boolean tlsClientCertBoundTokens)
tls_client_certificate_bound_access_tokens
client metadata
field.tlsClientCertBoundTokens
- true
indicates a preference
for TLS client certificate bound
access tokens, false
if
none.@Deprecated public boolean getMutualTLSSenderConstrainedAccessTokens()
tls_client_certificate_bound_access_tokens
client metadata
field.true
indicates a preference for TLS client
certificate bound access tokens, false
if none.@Deprecated public void setMutualTLSSenderConstrainedAccessTokens(boolean tlsSenderAccessTokens)
tls_client_certificate_bound_access_tokens
client metadata
field.tlsSenderAccessTokens
- true
indicates a preference for
TLS client certificate bound access
tokens, false
if none.public String getTLSClientAuthSubjectDN()
null
if not specified.public void setTLSClientAuthSubjectDN(String subjectDN)
subjectDN
- The expected subject distinguished name (DN) of the
client X.509 certificate, null
if not
specified.public Object getCustomField(String name)
name
- The field name. Must not be null
.null
if none.public net.minidev.json.JSONObject getCustomFields()
public void setCustomField(String name, Object value)
name
- The field name. Must not be null
.value
- The field value. Should serialise to a JSON entity.public void setCustomFields(net.minidev.json.JSONObject customFields)
customFields
- The custom metadata fields, as a JSON object,
empty object if none. Must not be null
.public void applyDefaults()
["code"]
.
["authorization_code"]
.
public net.minidev.json.JSONObject toJSONObject()
public net.minidev.json.JSONObject toJSONObject(boolean includeCustomFields)
includeCustomFields
- true
to include any custom
metadata fields, false
to omit
them.public static ClientMetadata parse(net.minidev.json.JSONObject jsonObject) throws ParseException
jsonObject
- The JSON object to parse. Must not be
null
.ParseException
- If the JSON object couldn't be parsed to a
client metadata instance.Copyright © 2018 Connect2id Ltd.. All rights reserved.