Package com.nimbusds.oauth2.sdk.client
Class ClientInformation
- java.lang.Object
-
- com.nimbusds.oauth2.sdk.client.ClientInformation
-
- Direct Known Subclasses:
OIDCClientInformation
@Immutable public class ClientInformation extends Object
Client information. Encapsulates the registration and metadata details of an OAuth 2.0 client:- The client identifier.
- The client metadata.
- The optional client secret for a confidential client.
- The optional registration URI and access token if dynamic client registration is permitted.
Related specifications:
- OAuth 2.0 Dynamic Client Registration Protocol (RFC 7591), section 3.2.1.
- OAuth 2.0 Dynamic Client Registration Management Protocol (RFC 7592), section 3.
-
-
Constructor Summary
Constructors Constructor Description ClientInformation(ClientID id, Date issueDate, ClientMetadata metadata, Secret secret)
Creates a new client information instance.ClientInformation(ClientID id, Date issueDate, ClientMetadata metadata, Secret secret, URI registrationURI, BearerAccessToken accessToken)
Creates a new client information instance permitting dynamic client registration management.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ClientID
getID()
Gets the client identifier.Date
getIDIssueDate()
Gets the issue date of the client identifier.ClientMetadata
getMetadata()
Gets the client metadata.static Set<String>
getRegisteredParameterNames()
Gets the registered client metadata parameter names.BearerAccessToken
getRegistrationAccessToken()
Gets the registration access token.URI
getRegistrationURI()
Gets the URI of the client registration.Secret
getSecret()
Gets the client secret.ClientType
inferClientType()
Infers the client type.static ClientInformation
parse(net.minidev.json.JSONObject jsonObject)
Parses a client information instance from the specified JSON object.net.minidev.json.JSONObject
toJSONObject()
Returns the JSON object representation of this client information instance.
-
-
-
Constructor Detail
-
ClientInformation
public ClientInformation(ClientID id, Date issueDate, ClientMetadata metadata, Secret secret)
Creates a new client information instance.- Parameters:
id
- The client identifier. Must not benull
.issueDate
- The issue date of the client identifier,null
if not specified.metadata
- The client metadata. Must not benull
.secret
- The optional client secret,null
if not specified.
-
ClientInformation
public ClientInformation(ClientID id, Date issueDate, ClientMetadata metadata, Secret secret, URI registrationURI, BearerAccessToken accessToken)
Creates a new client information instance permitting dynamic client registration management.- Parameters:
id
- The client identifier. Must not benull
.issueDate
- The issue date of the client identifier,null
if not specified.metadata
- The client metadata. Must not benull
.secret
- The optional client secret,null
if not specified.registrationURI
- The client registration URI,null
if not specified.accessToken
- The client registration access token,null
if not specified.
-
-
Method Detail
-
getRegisteredParameterNames
public static Set<String> getRegisteredParameterNames()
Gets the registered client metadata parameter names.- Returns:
- The registered parameter names, as an unmodifiable set.
-
getID
public ClientID getID()
Gets the client identifier. Corresponds to theclient_id
client registration parameter.- Returns:
- The client ID.
-
getIDIssueDate
public Date getIDIssueDate()
Gets the issue date of the client identifier. Corresponds to theclient_id_issued_at
client registration parameter.- Returns:
- The issue date,
null
if not specified.
-
getMetadata
public ClientMetadata getMetadata()
Gets the client metadata.- Returns:
- The client metadata.
-
getSecret
public Secret getSecret()
Gets the client secret. Corresponds to theclient_secret
andclient_secret_expires_at
client registration parameters.- Returns:
- The client secret,
null
if not specified.
-
inferClientType
public ClientType inferClientType()
Infers the client type.- Returns:
- The client type.
-
getRegistrationURI
public URI getRegistrationURI()
Gets the URI of the client registration. Corresponds to theregistration_client_uri
client registration parameter.- Returns:
- The registration URI,
null
if not specified.
-
getRegistrationAccessToken
public BearerAccessToken getRegistrationAccessToken()
Gets the registration access token. Corresponds to theregistration_access_token
client registration parameter.- Returns:
- The registration access token,
null
if not specified.
-
toJSONObject
public net.minidev.json.JSONObject toJSONObject()
Returns the JSON object representation of this client information instance.- Returns:
- The JSON object.
-
parse
public static ClientInformation parse(net.minidev.json.JSONObject jsonObject) throws ParseException
Parses a client information instance from the specified JSON object.- Parameters:
jsonObject
- The JSON object to parse. Must not benull
.- Returns:
- The client information.
- Throws:
ParseException
- If the JSON object couldn't be parsed to a client information instance.
-
-