Class ClientBuilder


  • public class ClientBuilder
    extends Object
    Builds a OAuth2 Client.
    Since:
    11.0.0
    • Constructor Detail

      • ClientBuilder

        public ClientBuilder()
    • Method Detail

      • setClientID

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

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

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

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

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

        public ClientBuilder setDisplayName​(List<String> displayName)
        Sets the display name of the OAuth2Client.
        Parameters:
        displayName - The display name.
      • setDisplayDescription

        public ClientBuilder setDisplayDescription​(List<String> displayDescription)
        Sets the client description of the OAuth2Client.
        Parameters:
        displayDescription - The client description.
      • setClientName

        public ClientBuilder setClientName​(List<String> clientName)
        Sets the client_name of the OAuth2Client
        Parameters:
        clientName - the client_name to set.
      • setSubjectType

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

        public ClientBuilder setIdTokenSignedResponseAlgorithm​(String idTokenSignedResponseAlgorithm)
        Sets the id token signed response alg of the OAuth2Client.
        Parameters:
        idTokenSignedResponseAlgorithm - The id token signed response alg.
      • setPostLogoutRedirectionURIs

        public ClientBuilder setPostLogoutRedirectionURIs​(List<String> postLogoutRedirectionURIs)
        Sets the post logout redirection URIs of the OAuth2Client.
        Parameters:
        postLogoutRedirectionURIs - The post logout redirection URIs.
      • setAccessToken

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

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

        public ClientBuilder setContacts​(List<String> contacts)
        Parameters:
        contacts - The contact information for the clients
        Returns:
      • setApplicationType

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

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

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

        public ClientBuilder setDefaultMaxAge​(Long defaultMaxAge)
        Sets the default max age on the OAuth2Client.
        Parameters:
        defaultMaxAge - The default max age, in seconds.
      • setDefaultMaxAgeEnabled

        public ClientBuilder setDefaultMaxAgeEnabled​(Boolean defaultMaxAgeEnabled)
        Sets whether to enforce the default max age.
        Parameters:
        defaultMaxAgeEnabled - Whether to enforce the default max age.
      • setTokenEndpointAuthMethod

        public ClientBuilder setTokenEndpointAuthMethod​(String tokenEndpointAuthMethod)
        Sets the token endpoint auth method value.
        Parameters:
        tokenEndpointAuthMethod - token endpoint auth method this client uses.
      • setJwks

        public ClientBuilder setJwks​(String jwks)
        Sets the JWKs value.
        Parameters:
        jwks - jwks containing valid public keys.
      • setJwksUri

        public ClientBuilder setJwksUri​(String jwksUri)
        Sets the JWKs URI value.
        Parameters:
        jwksUri - URL containing JWKs of valid public keys.
      • setX509

        public ClientBuilder setX509​(String x509)
        Sets the X509 value.
        Parameters:
        x509 - Public key certificate.
      • setPublicKeySelector

        public ClientBuilder setPublicKeySelector​(String selector)
        Sets the public key selector.
        Parameters:
        selector - Which of the public key types to use.
      • setSectorIdentifierUri

        public ClientBuilder setSectorIdentifierUri​(String sectorIdentifierUri)
        Sets the sector identifier uri.
        Parameters:
        sectorIdentifierUri - identifier uri to be used when pairwise.
      • setAuthorizationCodeLifeTime

        public ClientBuilder setAuthorizationCodeLifeTime​(Long authorizationCodeLifeTime)
        Sets the authorization code lifetime.
        Parameters:
        authorizationCodeLifeTime - Authorization code lifetime.
      • setAccessTokenLifeTime

        public ClientBuilder setAccessTokenLifeTime​(Long accessTokenLifeTime)
        Sets the Access token lifetime.
        Parameters:
        accessTokenLifeTime - Access token lifetime.
      • setRefreshTokenLifeTime

        public ClientBuilder setRefreshTokenLifeTime​(Long refreshTokenLifeTime)
        Sets the Refresh token lifetime.
        Parameters:
        refreshTokenLifeTime - Refresh token lifetime.
      • setJwtTokenLifeTime

        public ClientBuilder setJwtTokenLifeTime​(Long jwtTokenLifeTime)
        Sets the JWT token lifetime.
        Parameters:
        jwtTokenLifeTime - JWT token lifetime.
      • createClient

        public Client createClient()
        Creates the OAuth2 Client.
        Returns:
        The OAuth2 Client.