com.nimbusds.oauth2.sdk.reg
Class ClientMetadata

java.lang.Object
  extended by com.nimbusds.oauth2.sdk.reg.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:

Author:
Vladimir Dzhuvinov

Constructor Summary
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
 void applyDefaults()
          Applies the client metadata defaults where no values have been specified.
 List<javax.mail.internet.InternetAddress> getContacts()
          Gets the administrator contacts for the client.
 Set<GrantType> getGrantTypes()
          Gets the expected OAuth 2.0 grant types.
 URL 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.
 URL getLogoURI()
          Gets the client application logo.
 URL getLogoURI(com.nimbusds.langtag.LangTag langTag)
          Gets the client application logo.
 Map<com.nimbusds.langtag.LangTag,URL> getLogoURIEntries()
          Gets the client application logo entries.
 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.
 URL getPolicyURI()
          Gets the client policy for use of end-user data.
 URL getPolicyURI(com.nimbusds.langtag.LangTag langTag)
          Gets the client policy for use of end-user data.
 Map<com.nimbusds.langtag.LangTag,URL> getPolicyURIEntries()
          Gets the client policy entries for use of end-user data.
 Set<URL> getRedirectURIs()
          Gets the redirect URIs for this client.
 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.
 URL getTermsOfServiceURI()
          Gets the client's terms of service.
 URL getTermsOfServiceURI(com.nimbusds.langtag.LangTag langTag)
          Gets the client's terms of service.
 Map<com.nimbusds.langtag.LangTag,URL> getTermsOfServiceURIEntries()
          Gets the client's terms of service entries.
 ClientAuthenticationMethod getTokenEndpointAuthMethod()
          Gets the Token endpoint authentication method.
 URL getURI()
          Gets the client home page.
 URL getURI(com.nimbusds.langtag.LangTag langTag)
          Gets the client home page.
 Map<com.nimbusds.langtag.LangTag,URL> getURIEntries()
          Gets the client home page entries.
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)
          Sets the administrator contacts for the client.
 void setGrantTypes(Set<GrantType> grantTypes)
          Sets the expected OAuth 2.0 grant types.
 void setJWKSetURL(URL 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(URL logoURI)
          Sets the client application logo.
 void setLogoURI(URL logoURI, com.nimbusds.langtag.LangTag langTag)
          Sets the client application logo.
 void setName(String name)
          Sets the client name.
 void setName(String name, com.nimbusds.langtag.LangTag langTag)
          Sets the client name.
 void setPolicyURI(URL policyURI)
          Sets the client policy for use of end-user data.
 void setPolicyURI(URL policyURI, com.nimbusds.langtag.LangTag langTag)
          Sets the client policy for use of end-user data.
 void setRedirectURIs(Set<URL> redirectURIs)
          Sets the redirect URIs for this client.
 void setResponseTypes(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 setTermsOfServiceURI(URL tosURI)
          Sets the client's terms of service.
 void setTermsOfServiceURI(URL tosURI, com.nimbusds.langtag.LangTag langTag)
          Sets the client's terms of service.
 void setTokenEndpointAuthMethod(ClientAuthenticationMethod authMethod)
          Sets the Token endpoint authentication method.
 void setURI(URL uri)
          Sets the client home page.
 void setURI(URL 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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 be null.
Method Detail

getRedirectURIs

public Set<URL> getRedirectURIs()
Gets the redirect URIs for this client. Corresponds to the redirect_uris client registration parameter.

Returns:
The redirect URIs, null if not specified.

setRedirectURIs

public void setRedirectURIs(Set<URL> redirectURIs)
Sets the redirect URIs for this client. Corresponds to the redirect_uris client registration parameter.

Parameters:
redirectURIs - The redirect URIs, null if not specified.

getScope

public Scope getScope()
Gets the scope values that the client can use when requesting access tokens. Corresponds to the scope client registration parameter.

Returns:
The scope, null if not specified.

setScope

public void setScope(Scope scope)
Sets the scope values that the client can use when requesting access tokens. Corresponds to the scope client registration parameter.

Parameters:
scope - The scope, null if not specified.

getResponseTypes

public ResponseType getResponseTypes()
Gets the expected OAuth 2.0 response types. Corresponds to the response_types client registration parameter.

Returns:
The response types, null if not specified.

setResponseTypes

public void setResponseTypes(ResponseType responseTypes)
Sets the expected OAuth 2.0 response types. Corresponds to the response_types client registration parameter.

Parameters:
responseTypes - The response types, null if not specified.

getGrantTypes

public Set<GrantType> getGrantTypes()
Gets the expected OAuth 2.0 grant types. Corresponds to the grant_types client registration parameter.

Returns:
The grant types, null if not specified.

setGrantTypes

public void setGrantTypes(Set<GrantType> grantTypes)
Sets the expected OAuth 2.0 grant types. Corresponds to the grant_types client registration parameter.

Parameters:
grantTypes - The grant types, null if not specified.

getContacts

public List<javax.mail.internet.InternetAddress> getContacts()
Gets the administrator contacts for the client. Corresponds to the contacts client registration parameter.

Returns:
The administrator contacts, null if not specified.

setContacts

public void setContacts(List<javax.mail.internet.InternetAddress> contacts)
Sets the administrator contacts for the client. Corresponds to the contacts client registration parameter.

Parameters:
contacts - The administrator contacts, null if not specified.

getName

public String getName()
Gets the client name. Corresponds to the client_name client registration parameter, with no language tag.

Returns:
The client name, null if not specified.

getName

public String getName(com.nimbusds.langtag.LangTag langTag)
Gets the client name. Corresponds to the client_name client registration parameter, with an optional language tag.

Parameters:
langTag - The language tag of the entry, null to get the non-tagged entry.
Returns:
The client name, null if not specified.

getNameEntries

public Map<com.nimbusds.langtag.LangTag,String> getNameEntries()
Gets the client name entries. Corresponds to the client_name client registration parameter.

Returns:
The client name entries, empty map if none.

setName

public void setName(String name)
Sets the client name. Corresponds to the client_name client registration parameter, with no language tag.

Parameters:
name - The client name, null if not specified.

setName

public void setName(String name,
                    com.nimbusds.langtag.LangTag langTag)
Sets the client name. Corresponds to the client_name client registration parameter, with an optional language tag.

Parameters:
name - The client name. Must not be null.
langTag - The language tag, null if not specified.

getLogoURI

public URL getLogoURI()
Gets the client application logo. Corresponds to the logo_uri client registration parameter, with no language tag.

Returns:
The logo URI, null if not specified.

getLogoURI

public URL getLogoURI(com.nimbusds.langtag.LangTag langTag)
Gets the client application logo. Corresponds to the logo_uri client registration parameter, with an optional language tag.

Returns:
The logo URI, null if not specified.

getLogoURIEntries

public Map<com.nimbusds.langtag.LangTag,URL> getLogoURIEntries()
Gets the client application logo entries. Corresponds to the logo_uri client registration parameter.

Returns:
The logo URI entries, empty map if none.

setLogoURI

public void setLogoURI(URL logoURI)
Sets the client application logo. Corresponds to the logo_uri client registration parameter, with no language tag.

Parameters:
logoURI - The logo URI, null if not specified.

setLogoURI

public void setLogoURI(URL logoURI,
                       com.nimbusds.langtag.LangTag langTag)
Sets the client application logo. Corresponds to the logo_uri client registration parameter, with an optional language tag.

Parameters:
logoURI - The logo URI. Must not be null.
langTag - The language tag, null if not specified.

getURI

public URL getURI()
Gets the client home page. Corresponds to the client_uri client registration parameter, with no language tag.

Returns:
The client URI, null if not specified.

getURI

public URL getURI(com.nimbusds.langtag.LangTag langTag)
Gets the client home page. Corresponds to the client_uri client registration parameter, with an optional language tag.

Returns:
The client URI, null if not specified.

getURIEntries

public Map<com.nimbusds.langtag.LangTag,URL> getURIEntries()
Gets the client home page entries. Corresponds to the client_uri client registration parameter.

Returns:
The client URI entries, empty map if none.

setURI

public void setURI(URL uri)
Sets the client home page. Corresponds to the client_uri client registration parameter, with no language tag.

Parameters:
uri - The client URI, null if not specified.

setURI

public void setURI(URL uri,
                   com.nimbusds.langtag.LangTag langTag)
Sets the client home page. Corresponds to the client_uri client registration parameter, with an optional language tag.

Parameters:
uri - The URI. Must not be null.
langTag - The language tag, null if not specified.

getPolicyURI

public URL getPolicyURI()
Gets the client policy for use of end-user data. Corresponds to the policy_uri client registration parameter, with no language tag.

Returns:
The policy URI, null if not specified.

getPolicyURI

public URL getPolicyURI(com.nimbusds.langtag.LangTag langTag)
Gets the client policy for use of end-user data. Corresponds to the policy_url client registration parameter, with an optional language tag.

Returns:
The policy URI, null if not specified.

getPolicyURIEntries

public Map<com.nimbusds.langtag.LangTag,URL> getPolicyURIEntries()
Gets the client policy entries for use of end-user data. Corresponds to the policy_uri client registration parameter.

Returns:
The policy URI entries, empty map if none.

setPolicyURI

public void setPolicyURI(URL policyURI)
Sets the client policy for use of end-user data. Corresponds to the policy_uri client registration parameter, with no language tag.

Parameters:
policyURI - The policy URI, null if not specified.

setPolicyURI

public void setPolicyURI(URL policyURI,
                         com.nimbusds.langtag.LangTag langTag)
Sets the client policy for use of end-user data. Corresponds to the policy_uri client registration parameter, with an optional language tag.

Parameters:
policyURI - The policy URI. Must not be null.
langTag - The language tag, null if not specified.

getTermsOfServiceURI

public URL getTermsOfServiceURI()
Gets the client's terms of service. Corresponds to the tos_uri client registration parameter, with no language tag.

Returns:
The terms of service URI, null if not specified.

getTermsOfServiceURI

public URL getTermsOfServiceURI(com.nimbusds.langtag.LangTag langTag)
Gets the client's terms of service. Corresponds to the tos_uri client registration parameter, with an optional language tag.

Returns:
The terms of service URI, null if not specified.

getTermsOfServiceURIEntries

public Map<com.nimbusds.langtag.LangTag,URL> getTermsOfServiceURIEntries()
Gets the client's terms of service entries. Corresponds to the tos_uri client registration parameter.

Returns:
The terms of service URI entries, empty map if none.

setTermsOfServiceURI

public void setTermsOfServiceURI(URL tosURI)
Sets the client's terms of service. Corresponds to the tos_uri client registration parameter, with no language tag.

Parameters:
tosURI - The terms of service URI, null if not specified.

setTermsOfServiceURI

public void setTermsOfServiceURI(URL tosURI,
                                 com.nimbusds.langtag.LangTag langTag)
Sets the client's terms of service. Corresponds to the tos_uri client registration parameter, with an optional language tag.

Parameters:
tosURI - The terms of service URI. Must not be null.
langTag - The language tag, null if not specified.

getTokenEndpointAuthMethod

public ClientAuthenticationMethod getTokenEndpointAuthMethod()
Gets the Token endpoint authentication method. Corresponds to the token_endpoint_auth_method client registration parameter.

Returns:
The Token endpoint authentication method, null if not specified.

setTokenEndpointAuthMethod

public void setTokenEndpointAuthMethod(ClientAuthenticationMethod authMethod)
Sets the Token endpoint authentication method. Corresponds to the token_endpoint_auth_method client registration parameter.

Parameters:
authMethod - The Token endpoint authentication method, null if not specified.

getJWKSetURI

public URL 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 the jwks_uri client registration parameter.

Returns:
The JWK set URI, null if not specified.

setJWKSetURL

public void setJWKSetURL(URL 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 the jwks_uri client registration parameter.

Parameters:
jwkSetURI - The JWK set URI, null if not specified.

applyDefaults

public void applyDefaults()
Applies the client metadata defaults where no values have been specified.


toJSONObject

public net.minidev.json.JSONObject toJSONObject()
Returns the JSON object representation of this client metadata.

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 be null.
Returns:
The client metadata.
Throws:
ParseException - If the JSON object couldn't be parsed to a client metadata instance.


Copyright © 2013 NimbusDS. All Rights Reserved.