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 ClientIDgetID()Gets the client identifier.DategetIDIssueDate()Gets the issue date of the client identifier.ClientMetadatagetMetadata()Gets the client metadata.static Set<String>getRegisteredParameterNames()Gets the registered client metadata parameter names.BearerAccessTokengetRegistrationAccessToken()Gets the registration access token.URIgetRegistrationURI()Gets the URI of the client registration.SecretgetSecret()Gets the client secret.ClientTypeinferClientType()Infers the client type.static ClientInformationparse(net.minidev.json.JSONObject jsonObject)Parses a client information instance from the specified JSON object.net.minidev.json.JSONObjecttoJSONObject()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,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 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_idclient registration parameter.- Returns:
- The client ID.
-
getIDIssueDate
public Date 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
public ClientMetadata getMetadata()
Gets the client metadata.- Returns:
- The client metadata.
-
getSecret
public Secret getSecret()
Gets the client secret. Corresponds to theclient_secretandclient_secret_expires_atclient registration parameters.- Returns:
- The client secret,
nullif 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_uriclient registration parameter.- Returns:
- The registration URI,
nullif not specified.
-
getRegistrationAccessToken
public BearerAccessToken getRegistrationAccessToken()
Gets the registration access token. Corresponds to theregistration_access_tokenclient registration parameter.- Returns:
- The registration access token,
nullif 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.
-
-