Class 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 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 be null.
        issueDate - The issue date of the client identifier, null if not specified.
        metadata - The client metadata. Must not be null.
        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 be null.
        issueDate - The issue date of the client identifier, null if not specified.
        metadata - The client metadata. Must not be null.
        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<StringgetRegisteredParameterNames()
        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 the client_id client registration parameter.
        Returns:
        The client ID.
      • getIDIssueDate

        public Date getIDIssueDate()
        Gets the issue date of the client identifier. Corresponds to the client_id_issued_at client registration parameter.
        Returns:
        The issue date, null if not specified.
      • getSecret

        public Secret getSecret()
        Gets the client secret. Corresponds to the client_secret and client_secret_expires_at client registration parameters.
        Returns:
        The client secret, null if not specified.
      • getRegistrationURI

        public URI getRegistrationURI()
        Gets the URI of the client registration. Corresponds to the registration_client_uri client registration parameter.
        Returns:
        The registration URI, null if not specified.
      • getRegistrationAccessToken

        public BearerAccessToken getRegistrationAccessToken()
        Gets the registration access token. Corresponds to the registration_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 be null.
        Returns:
        The client information.
        Throws:
        ParseException - If the JSON object couldn't be parsed to a client information instance.