Class AccessTokenSecretStore.Builder

    • Constructor Detail

      • Builder

        public Builder()
    • Method Detail

      • forPurpose

        public AccessTokenSecretStore.Builder forPurpose​(Purpose<GenericSecret> purpose)
        Configures the purpose for which this access token store is to be used.
        Parameters:
        purpose - the purpose for which access tokens are being used.
        Returns:
        this builder object.
      • withHandler

        public AccessTokenSecretStore.Builder withHandler​(Handler handler)
        Configures the Handler to use for sending requests to the token endpoint.
        Parameters:
        handler - the client handler.
        Returns:
        this builder object.
      • withClientSecretBasicAuth

        public AccessTokenSecretStore.Builder withClientSecretBasicAuth​(String clientId,
                                                                        SecretReference<GenericSecret> clientSecretRef)
        Configures the token store to supply client credentials via HTTP Basic Authentication.
        Parameters:
        clientId - the client id.
        clientSecretRef - a reference to the client secret.
        Returns:
        this builder object.
      • withClientSecretPostAuth

        public AccessTokenSecretStore.Builder withClientSecretPostAuth​(String clientId,
                                                                       SecretReference<GenericSecret> clientSecretRef)
        Configures the token store to supply client credentials via client_secret_post method.
        Parameters:
        clientId - the client id.
        clientSecretRef - a reference to retrieve the client secret.
        Returns:
        this builder object.
      • withInitialGrantTypeHandler

        public AccessTokenSecretStore.Builder withInitialGrantTypeHandler​(GrantTypeHandler grantType)
        Configures the initial grant type handler to use for calling the token endpoint. If the response from the token endpoint includes a refresh token, then the store will switch to using a refresh token grant from then on.
        Parameters:
        grantType - the initial grant type handler.
        Returns:
        this object.
      • withClock

        public AccessTokenSecretStore.Builder withClock​(Clock clock)
        The clock to use for determining when an access token has expired.
        Parameters:
        clock - the clock.
        Returns:
        this builder object.
      • withTokenEndpoint

        public AccessTokenSecretStore.Builder withTokenEndpoint​(URI tokenEndpoint)
        Configures the URI of the OAuth 2 token endpoint to call to obtain access tokens.
        Parameters:
        tokenEndpoint - the token endpoint URI.
        Returns:
        this builder object.
      • withTokenEndpoint

        public AccessTokenSecretStore.Builder withTokenEndpoint​(String tokenEndpoint)
        Configures the URI of the OAuth 2 token endpoint to call to obtain access tokens.
        Parameters:
        tokenEndpoint - the token endpoint URI.
        Returns:
        this builder object.