Package com.nimbusds.oauth2.sdk.client
Class ClientInformation
java.lang.Object
com.nimbusds.oauth2.sdk.client.ClientInformation
- Direct Known Subclasses:
OIDCClientInformation
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
ConstructorsConstructorDescriptionClientInformation
(ClientID id, ClientMetadata metadata) Creates a new minimal client information instance without a client secret.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
Modifier and TypeMethodDescriptiongetID()
Gets the client identifier.Gets the issue date of the client identifier.Gets the client metadata.Gets the registered client metadata parameter names.Gets the registration access token.Gets the URI of the client registration.Gets the client secret.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
Returns the JSON object representation of this client information instance.
-
Constructor Details
-
ClientInformation
Creates a new minimal client information instance without a client secret.- Parameters:
id
- The client identifier. Must not benull
.metadata
- The client metadata. Must not benull
.
-
ClientInformation
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 Details
-
getRegisteredParameterNames
Gets the registered client metadata parameter names.- Returns:
- The registered parameter names, as an unmodifiable set.
-
getID
Gets the client identifier. Corresponds to theclient_id
client registration parameter.- Returns:
- The client ID.
-
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
Gets the client metadata.- Returns:
- The client metadata.
-
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
Infers the client type.- Returns:
- The client type.
-
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
Gets the registration access token. Corresponds to theregistration_access_token
client registration parameter.- Returns:
- The registration access token,
null
if not specified.
-
toJSONObject
Returns the JSON object representation of this client information instance.- Returns:
- The JSON object.
-
parse
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.
-