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)
- OAuth 2.0 Dynamic Client Registration Management Protocol (RFC 7592)
-
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 ClientInformationparse(net.minidev.json.JSONObject jsonObject) Parses a client information instance from the specified JSON object.net.minidev.json.JSONObjectReturns 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,nullif not specified.metadata- The client metadata. Must not benull.secret- The optional client secret,nullif 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,nullif not specified.metadata- The client metadata. Must not benull.secret- The optional client secret,nullif not specified.registrationURI- The client registration URI,nullif not specified.accessToken- The client registration access token,nullif 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_idclient registration parameter.- Returns:
- The client ID.
-
getIDIssueDate
Gets the issue date of the client identifier. Corresponds to theclient_id_issued_atclient registration parameter.- Returns:
- The issue date,
nullif not specified.
-
getMetadata
Gets the client metadata.- Returns:
- The client metadata.
-
getSecret
Gets the client secret. Corresponds to theclient_secretandclient_secret_expires_atclient registration parameters.- Returns:
- The client secret,
nullif not specified.
-
inferClientType
Infers the client type.- Returns:
- The client type.
-
getRegistrationURI
Gets the URI of the client registration. Corresponds to theregistration_client_uriclient registration parameter.- Returns:
- The registration URI,
nullif not specified.
-
getRegistrationAccessToken
Gets the registration access token. Corresponds to theregistration_access_tokenclient registration parameter.- Returns:
- The registration access token,
nullif 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.
-