Class TokenRequest.Builder

    • Constructor Detail

      • Builder

        public Builder()
    • Method Detail

      • clientSecret

        public TokenRequest.Builder clientSecret​(String clientSecret)
        Set the client secret value.
        Parameters:
        clientSecret - the client secret
        Returns:
        this builder
      • codeVerifier

        public TokenRequest.Builder codeVerifier​(String codeVerifier)
        Set the PKCE code verifier for the token endpoint.
        Parameters:
        codeVerifier - the code verifier
        Returns:
        this builder
      • scopes

        public TokenRequest.Builder scopes​(String... scopes)
        Set one or more scope values.
        Parameters:
        scopes - the scope values
        Returns:
        this builder
      • authMethod

        public TokenRequest.Builder authMethod​(String authMethod)
        Set the authentication method for the token endpoint.
        Parameters:
        authMethod - the authentication method
        Returns:
        this builder
      • code

        public TokenRequest.Builder code​(String code)
        Set the authorization code value.
        Parameters:
        code - the authorization code
        Returns:
        this builder
      • redirectUri

        public TokenRequest.Builder redirectUri​(URI redirectUri)
        Set the redirect URI value.
        Parameters:
        redirectUri - the redirect URI
        Returns:
        this builder
      • build

        public TokenRequest build​(String grantType,
                                  String clientId)
        Build a token request.
        Parameters:
        grantType - the grant type
        clientId - the client id
        Returns:
        the token request