Class Client

  • All Implemented Interfaces:
    Cloneable, Iterable<org.forgerock.json.JsonValue>

    public class Client
    extends org.forgerock.json.JsonValue
    Models a OAuth2 Client.
    Since:
    12.0.0
    • Constructor Detail

      • Client

        public Client​(String clientID,
                      String clientType,
                      List<String> redirectionURIs,
                      List<String> allowedGrantScopes,
                      List<String> defaultGrantScopes,
                      List<String> displayName,
                      List<String> displayDescription,
                      List<String> clientName,
                      String subjectType,
                      String idTokenSignedResponseAlgorithm,
                      List<String> postLogoutRedirectionURIs,
                      String accessToken,
                      String clientSessionURI,
                      String applicationType,
                      String clientSecret,
                      List<String> responseTypes,
                      List<String> contacts,
                      Long defaultMaxAge,
                      Boolean defaultMaxAgeEnabled,
                      String tokenEndpointAuthMethod,
                      String jwks,
                      String jwksUri,
                      String x509,
                      String selector,
                      String sectorIdUri,
                      Long authorizationCodeLifeTime,
                      Long accessTokenLifeTime,
                      Long refreshTokenLifeTime,
                      Long jwtTokenLifeTime)
        Creates a OAuth2Client.
        Parameters:
        clientID - The client id of the client.
        clientType - The client type of the client.
        redirectionURIs - The redirection uris of the client.
        allowedGrantScopes - The allowed scopes of the client.
        defaultGrantScopes - The default scopes of the client.
        displayName - The display name of the client
        displayDescription - The client description of the client.
        clientName - The client name of the client.
        subjectType - The subject type of the client.
        idTokenSignedResponseAlgorithm - The id token signed response algorithm of the client.
        postLogoutRedirectionURIs - The post logout redirect URIs of the client.
        accessToken - The registration access token of the client.
        clientSessionURI - The client session uri of the client.
        applicationType - The application type of the client.
        clientSecret - The client secret of the client.
        responseTypes - The response types of the client.
        contacts - The contact information for the client (can be null).
        defaultMaxAge - The default maximum age a session can be when authorizing, in seconds.
        defaultMaxAgeEnabled - Whether we enforce the defaultMaxAge parameter or not.
        tokenEndpointAuthMethod - The token endpoint's authentication method.
        jwks - The client's public key jwks.
        jwksUri - The client's public key jwks_uri.
        x509 - The client's public key x509.
        selector - Selector for the public key format.
        sectorIdUri - Client's sector ID Uri.
        authorizationCodeLifeTime - The client's authorization code lifetime.
        accessTokenLifeTime - The client's access token lifetime.
        refreshTokenLifeTime - The client's refresh token lifetime.
        jwtTokenLifeTime - The client's JWT token lifetime.
    • Method Detail

      • getJwks

        public String getJwks()
        Gets JWKs for this client.
      • getJwksUri

        public String getJwksUri()
        Gets JWKs_URI for this client.
      • getX509

        public String getX509()
        Gets X509 certificate for this client.
      • getKeySelector

        public String getKeySelector()
        Returns the key selector for this client.
      • getClientID

        public String getClientID()
        Gets the client id of the OAuth2Client.
        Returns:
        The client id.
      • getDefaultMaxAge

        public Long getDefaultMaxAge()
        Gets the default max age of the OAuth2Client.
        Returns:
        the default max age.
      • getDefaultMaxAgeEnabled

        public Boolean getDefaultMaxAgeEnabled()
        Gets whether the max age value is enforced.
        Returns:
        true if enforced, false otherwise.
      • setClientID

        public void setClientID​(String clientID)
        Sets the client id of the OAuth2Client.
        Parameters:
        clientID - The client id.
      • getClientType

        public Client.ClientType getClientType()
        Gets the client type of the OAuth2Client. If the client type is null, null is returned.
        Returns:
        The client type.
      • setClientType

        public void setClientType​(String clientType)
        Sets the client type of the OAuth2Client.
        Parameters:
        clientType - The client type.
      • getRedirectionURIs

        public Set<URI> getRedirectionURIs()
        Gets the redirection uris of the OAuth2Client. If the redirection uris is null, null is returned.
        Returns:
        The redirection uris as URIs.
      • getRedirectionURIsAsString

        public Set<String> getRedirectionURIsAsString()
        Gets the redirection uris of the OAuth2Client. If the redirection uris is null, null is returned.
        Returns:
        The redirection uris as Strings.
      • setRedirectionURIs

        public void setRedirectionURIs​(List<String> redirectionURIs)
        Sets the redirection uris of the OAuth2Client.
        Parameters:
        redirectionURIs - The redirection uris.
      • setSectorIdUri

        public void setSectorIdUri​(String sectorIdUri)
        Sets the sector id uri.
      • getSectorIdUri

        public String getSectorIdUri()
        Returns the sector id uri for this client if set.
      • getAllowedGrantScopes

        public Set<String> getAllowedGrantScopes()
        Gets the allowed scopes of the OAuth2Client. If the allowed scopes is null, null is returned.
        Returns:
        The allowed scopes.
      • setAllowedGrantScopes

        public void setAllowedGrantScopes​(List<String> allowedGrantScopes)
        Sets the allowed scopes of the OAuth2Client.
        Parameters:
        allowedGrantScopes - The allowed scopes.
      • getDefaultGrantScopes

        public Set<String> getDefaultGrantScopes()
        Gets the default scopes of the OAuth2Client. If the default scopes is null, null, is returned.
        Returns:
        The default scopes.
      • setDefaultGrantScopes

        public void setDefaultGrantScopes​(List<String> defaultGrantScopes)
        Sets the default scopes of the OAuth2Client.
        Parameters:
        defaultGrantScopes - The default scopes.
      • getDisplayName

        public Set<String> getDisplayName()
        Gets the display names of the OAuth2Client. If the display names is null, null is returned.
        Returns:
        The display names.
      • setDisplayName

        public void setDisplayName​(List<String> displayName)
        Sets the display names of the OAuth2Client.
        Parameters:
        displayName - The display names.
      • getDisplayDescription

        public Set<String> getDisplayDescription()
        Gets the client descriptions of the OAuth2Client. If the client descriptions is null, null is returned.
        Returns:
        The client descriptions.
      • setDisplayDescription

        public void setDisplayDescription​(List<String> displayDescription)
        Sets the client descriptions of the OAuth2Client.
        Parameters:
        displayDescription - The client descriptions.
      • getClientName

        public Set<String> getClientName()
        Gets the client names of the OAuth2Client. If the client name is null, null is returned.
        Returns:
        The client names.
      • setClientName

        public void setClientName​(List<String> clientName)
        Sets the client names of the OAuth2Client.
        Parameters:
        clientName - The client names.
      • getSubjectType

        public Client.SubjectType getSubjectType()
        Gets the subject type of the OAuth2Client.
        Returns:
        The subject type.
      • setSubjectType

        public void setSubjectType​(String subjectType)
        Sets the subject type of the OAuth2Client.
        Parameters:
        subjectType - The subject type.
      • getIdTokenSignedResponseAlgorithm

        public String getIdTokenSignedResponseAlgorithm()
        Gets the id token signed response alg of the OAuth2Client.
        Returns:
        The id token signed response alg.
      • setIdTokenSignedResponseAlgorithm

        public void setIdTokenSignedResponseAlgorithm​(String idTokenSignedResponseAlgorithm)
        Sets the id token signed response alg of the OAuth2Client.
        If the specified idTokenSignedResponseAlgorithm is null the value is defaulted to 'HS256'.
        Parameters:
        idTokenSignedResponseAlgorithm - The id token signed response alg.
      • getPostLogoutRedirectionURIs

        public List<String> getPostLogoutRedirectionURIs()
        Gets the post logout redirection uri of the OAuth2Client. If the logout redirection uri is null, null is returned.
        Returns:
        The post logout redirection uri.
      • setPostLogoutRedirectionURIs

        public void setPostLogoutRedirectionURIs​(List<String> postLogoutRedirectionURIs)
        Sets the post logout redirection uri of the OAuth2Client.
        Parameters:
        postLogoutRedirectionURIs - The post logout redirection uri.
      • getAccessToken

        public String getAccessToken()
        Gets the registration access token of the OAuth2Client. If the registration access token is null, null is returned.
        Returns:
        The registration access token.
      • setAccessToken

        public void setAccessToken​(String accessToken)
        Sets the registration access token of the OAuth2Client.
        Parameters:
        accessToken - The registration access token.
      • hasAccessToken

        public boolean hasAccessToken()
        Indicates whether this client has a registration access token or not.
      • getClientSessionURI

        public String getClientSessionURI()
        Gets the client session uri of the OAuth2Client. If the client session uri is null, null is returned.
        Returns:
        The client session uri.
      • setClientSessionURI

        public void setClientSessionURI​(String clientSessionURI)
        Sets the client session uri of the OAuth2Client.
        Parameters:
        clientSessionURI - The client session uri.
      • getApplicationType

        public Client.ApplicationType getApplicationType()
        Gets the application type of the OAuth2Client. If the application type is null, null is returned.
        Returns:
        The application type.
      • setApplicationType

        public void setApplicationType​(String applicationType)
        Sets the application type of the OAuth2Client.
        Parameters:
        applicationType - The application type.
      • getClientSecret

        public String getClientSecret()
        Gets the client secret of the OAuth2Client. If the client secret is null, null is returned.
        Returns:
        The client's secret.
      • setClientSecret

        public void setClientSecret​(String clientSecret)
        Sets the client secret of the OAuth2Client.
        Parameters:
        clientSecret - The client's secret.
      • getResponseTypes

        public Set<String> getResponseTypes()
        Gets the response types. If the response types value is null, null will be returned.
        Returns:
        A Set of response types.
      • setResponseTypes

        public void setResponseTypes​(List<String> responseTypes)
        Sets the response types of the OAuth2Client.
        Parameters:
        responseTypes - The response types.
      • setDefaultMaxAgeEnabled

        public void setDefaultMaxAgeEnabled​(Boolean defaultMaxAgeEnabled)
        Sets whether the default max age value is to be utilised.
        Parameters:
        defaultMaxAgeEnabled - The default max age.
      • getTokenEndpointAuthMethod

        public Client.TokenEndpointAuthMethod getTokenEndpointAuthMethod()
        Gets the token endpoint auth method.
        Returns:
        The token endpoint auth method.
      • setTokenEndpointAuthMethod

        public void setTokenEndpointAuthMethod​(String tokenEndpointAuthMethod)
        Sets the token endpoint auth method.
        Parameters:
        tokenEndpointAuthMethod - the token endpoint auth method to use.
      • setDefaultMaxAge

        public void setDefaultMaxAge​(Long defaultMaxAge)
        Sets the default max age of the OAuth2Client. Minimum enforced value of 60.
        Parameters:
        defaultMaxAge - The default max age.
      • getContacts

        public Set<String> getContacts()
        Gets the contacts. If the contacts value is null, null will be returned.
        Returns:
        A Set of contacts
      • setContacts

        public void setContacts​(List<String> contacts)
        Sets the contacts of the OAuth2Client.
        Parameters:
        contacts - The contacts.
      • getAuthorizationCodeLifeTime

        public Long getAuthorizationCodeLifeTime()
        Gets the authorization code lifetime of the OAuth2Client.
        Returns:
        the authorization code lifetime.
      • setAuthorizationCodeLifeTime

        public void setAuthorizationCodeLifeTime​(Long authorizationCodeLifeTime)
        Sets the authorization code lifetime of the OAuth2Client.
        Parameters:
        authorizationCodeLifeTime - The authorization code lifetime.
      • getAccessTokenLifeTime

        public Long getAccessTokenLifeTime()
        Gets the access token lifetime of the OAuth2Client.
        Returns:
        the access token lifetime.
      • setAccessTokenLifeTime

        public void setAccessTokenLifeTime​(Long accessTokenLifeTime)
        Sets the access token lifetime of the OAuth2Client.
        Parameters:
        accessTokenLifeTime - The access token lifetime.
      • getRefreshTokenLifeTime

        public Long getRefreshTokenLifeTime()
        Gets the refresh token lifetime of the OAuth2Client.
        Returns:
        the refresh token lifetime.
      • setRefreshTokenLifeTime

        public void setRefreshTokenLifeTime​(Long refreshTokenLifeTime)
        Sets the refresh token lifetime of the OAuth2Client.
        Parameters:
        refreshTokenLifeTime - The refresh token lifetime.
      • getJwtTokenLifeTime

        public Long getJwtTokenLifeTime()
        Gets the JWT token lifetime of the OAuth2Client.
        Returns:
        the JWT token lifetime.
      • setJwtTokenLifeTime

        public void setJwtTokenLifeTime​(Long jwtTokenLifeTime)
        Sets the JWT token lifetime of the OAuth2Client.
        Parameters:
        jwtTokenLifeTime - The JWT token lifetime.