public class ClientMetadata extends java.lang.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.
|
java.util.List<javax.mail.internet.InternetAddress> |
getContacts()
Gets the administrator contacts for the client.
|
java.lang.Object |
getCustomField(java.lang.String name)
Gets the specified custom metadata field.
|
net.minidev.json.JSONObject |
getCustomFields()
Gets the custom metadata fields.
|
java.util.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.
|
java.net.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.
|
java.net.URI |
getLogoURI()
Gets the client application logo.
|
java.net.URI |
getLogoURI(com.nimbusds.langtag.LangTag langTag)
Gets the client application logo.
|
java.util.Map<com.nimbusds.langtag.LangTag,java.net.URI> |
getLogoURIEntries()
Gets the client application logo entries.
|
java.lang.String |
getName()
Gets the client name.
|
java.lang.String |
getName(com.nimbusds.langtag.LangTag langTag)
Gets the client name.
|
java.util.Map<com.nimbusds.langtag.LangTag,java.lang.String> |
getNameEntries()
Gets the client name entries.
|
java.net.URI |
getPolicyURI()
Gets the client policy for use of end-user data.
|
java.net.URI |
getPolicyURI(com.nimbusds.langtag.LangTag langTag)
Gets the client policy for use of end-user data.
|
java.util.Map<com.nimbusds.langtag.LangTag,java.net.URI> |
getPolicyURIEntries()
Gets the client policy entries for use of end-user data.
|
java.util.Set<java.net.URI> |
getRedirectionURIs()
Gets the redirection URIs for this client.
|
java.util.Set<java.lang.String> |
getRedirectionURIStrings()
Gets the redirection URIs for this client as strings.
|
static java.util.Set<java.lang.String> |
getRegisteredParameterNames()
Gets the registered (standard) OAuth 2.0 client metadata parameter
names.
|
java.util.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.
|
java.net.URI |
getTermsOfServiceURI()
Gets the client's terms of service.
|
java.net.URI |
getTermsOfServiceURI(com.nimbusds.langtag.LangTag langTag)
Gets the client's terms of service.
|
java.util.Map<com.nimbusds.langtag.LangTag,java.net.URI> |
getTermsOfServiceURIEntries()
Gets the client's terms of service entries.
|
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.
|
java.net.URI |
getURI()
Gets the client home page.
|
java.net.URI |
getURI(com.nimbusds.langtag.LangTag langTag)
Gets the client home page.
|
java.util.Map<com.nimbusds.langtag.LangTag,java.net.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(java.util.List<javax.mail.internet.InternetAddress> contacts)
Sets the administrator contacts for the client.
|
void |
setCustomField(java.lang.String name,
java.lang.Object value)
Sets the specified custom metadata field.
|
void |
setCustomFields(net.minidev.json.JSONObject customFields)
Sets the custom metadata fields.
|
void |
setGrantTypes(java.util.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(java.net.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(java.net.URI logoURI)
Sets the client application logo.
|
void |
setLogoURI(java.net.URI logoURI,
com.nimbusds.langtag.LangTag langTag)
Sets the client application logo.
|
void |
setName(java.lang.String name)
Sets the client name.
|
void |
setName(java.lang.String name,
com.nimbusds.langtag.LangTag langTag)
Sets the client name.
|
void |
setPolicyURI(java.net.URI policyURI)
Sets the client policy for use of end-user data.
|
void |
setPolicyURI(java.net.URI policyURI,
com.nimbusds.langtag.LangTag langTag)
Sets the client policy for use of end-user data.
|
void |
setRedirectionURI(java.net.URI redirectURI)
Sets a single redirection URI for this client.
|
void |
setRedirectionURIs(java.util.Set<java.net.URI> redirectURIs)
Sets the redirection URIs for this client.
|
void |
setResponseTypes(java.util.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(java.net.URI tosURI)
Sets the client's terms of service.
|
void |
setTermsOfServiceURI(java.net.URI tosURI,
com.nimbusds.langtag.LangTag langTag)
Sets the client's terms of service.
|
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(java.net.URI uri)
Sets the client home page.
|
void |
setURI(java.net.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.
|
public ClientMetadata()
public ClientMetadata(ClientMetadata metadata)
metadata - The client metadata to copy. Must not be
null.public static java.util.Set<java.lang.String> getRegisteredParameterNames()
public java.util.Set<java.net.URI> getRedirectionURIs()
redirect_uris client metadata field.null if not specified.public java.util.Set<java.lang.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(java.util.Set<java.net.URI> redirectURIs)
redirect_uris client metadata field.redirectURIs - The redirection URIs, null if not
specified.public void setRedirectionURI(java.net.URI redirectURI)
redirect_uris client metadata field.redirectURI - The redirection URIs, null if not
specified.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 java.util.Set<ResponseType> getResponseTypes()
response_types client metadata field.null if not specified.public void setResponseTypes(java.util.Set<ResponseType> responseTypes)
response_types client metadata field.responseTypes - The response types, null if not
specified.public java.util.Set<GrantType> getGrantTypes()
grant_types client metadata field.null if not specified.public void setGrantTypes(java.util.Set<GrantType> grantTypes)
grant_types client metadata field.grantTypes - The grant types, null if not specified.public java.util.List<javax.mail.internet.InternetAddress> getContacts()
contacts client metadata field.null if not specified.public void setContacts(java.util.List<javax.mail.internet.InternetAddress> contacts)
contacts client metadata field.contacts - The administrator contacts, null if not
specified.public java.lang.String getName()
client_name client
metadata field, with no language tag.null if not specified.public java.lang.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 java.util.Map<com.nimbusds.langtag.LangTag,java.lang.String> getNameEntries()
client_name
client metadata field.public void setName(java.lang.String name)
client_name client
metadata field, with no language tag.name - The client name, null if not specified.public void setName(java.lang.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 java.net.URI getLogoURI()
logo_uri client metadata field, with no language
tag.null if not specified.public java.net.URI getLogoURI(com.nimbusds.langtag.LangTag langTag)
logo_uri client metadata field, with an optional
language tag.null if not specified.public java.util.Map<com.nimbusds.langtag.LangTag,java.net.URI> getLogoURIEntries()
logo_uri client metadata field.public void setLogoURI(java.net.URI logoURI)
logo_uri client metadata field, with no language
tag.logoURI - The logo URI, null if not specified.public void setLogoURI(java.net.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 java.net.URI getURI()
client_uri
client metadata field, with no language tag.null if not specified.public java.net.URI getURI(com.nimbusds.langtag.LangTag langTag)
client_uri
client metadata field, with an optional language tag.null if not specified.public java.util.Map<com.nimbusds.langtag.LangTag,java.net.URI> getURIEntries()
client_uri client metadata field.public void setURI(java.net.URI uri)
client_uri
client metadata field, with no language tag.uri - The client URI, null if not specified.public void setURI(java.net.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 java.net.URI getPolicyURI()
policy_uri client metadata field, with no language
tag.null if not specified.public java.net.URI getPolicyURI(com.nimbusds.langtag.LangTag langTag)
policy_uri client metadata field, with an optional
language tag.null if not specified.public java.util.Map<com.nimbusds.langtag.LangTag,java.net.URI> getPolicyURIEntries()
policy_uri client metadata field.public void setPolicyURI(java.net.URI policyURI)
policy_uri client metadata field, with no language
tag.policyURI - The policy URI, null if not specified.public void setPolicyURI(java.net.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 java.net.URI getTermsOfServiceURI()
tos_uri client metadata field, with no language
tag.null if not specified.public java.net.URI getTermsOfServiceURI(com.nimbusds.langtag.LangTag langTag)
tos_uri client metadata field, with an optional
language tag.null if not specified.public java.util.Map<com.nimbusds.langtag.LangTag,java.net.URI> getTermsOfServiceURIEntries()
tos_uri client metadata field.public void setTermsOfServiceURI(java.net.URI tosURI)
tos_uri client metadata field, with no language
tag.tosURI - The terms of service URI, null if not
specified.public void setTermsOfServiceURI(java.net.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 java.net.URI getJWKSetURI()
jwks_uri client
metadata field.null if not specified.public void setJWKSetURI(java.net.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 java.lang.Object getCustomField(java.lang.String name)
name - The field name. Must not be null.null if none.public net.minidev.json.JSONObject getCustomFields()
public void setCustomField(java.lang.String name, java.lang.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 © 2016 Connect2id Ltd.. All Rights Reserved.