Class OAuth2ClientConfiguration.Builder<T extends OAuth2ClientConfiguration.Builder<T,C>,C extends OAuth2ClientConfiguration>

java.lang.Object
org.forgerock.oauth.OAuthClientConfiguration.Builder<T,C>
org.forgerock.oauth.clients.oauth2.OAuth2ClientConfiguration.Builder<T,C>
Type Parameters:
T - the type of OAuthClientConfiguration builder to build.
C - the type of OAuthClientConfiguration to build.
Direct Known Subclasses:
FacebookClientConfiguration.Builder, LinkedInClientConfiguration.Builder, OpenIDConnectClientConfiguration.Builder
Enclosing class:
OAuth2ClientConfiguration

public abstract static class OAuth2ClientConfiguration.Builder<T extends OAuth2ClientConfiguration.Builder<T,C>,C extends OAuth2ClientConfiguration> extends OAuthClientConfiguration.Builder<T,C>
Builder class for creating the OAuth2ClientConfiguration.
  • Constructor Details

    • Builder

      protected Builder(Function<T,C> builder)
      Limit constructor visibility.
      Parameters:
      builder - OAuth2ClientConfiguration builder
  • Method Details

    • withClientId

      public T withClientId(String clientId)
      Set the clientId.
      Parameters:
      clientId - identifier of client.
      Returns:
      Builder
    • withClientSecret

      @Deprecated public T withClientSecret(String clientSecret)
      Deprecated.
      Set the clientSecret.
      Parameters:
      clientSecret - client password.
      Returns:
      Builder
    • withClientSecret

      public T withClientSecret(SecretReference<GenericSecret> clientSecret)
      Set the clientSecret.
      Parameters:
      clientSecret - client password.
      Returns:
      Builder
    • withAuthorizationEndpoint

      public T withAuthorizationEndpoint(String authorizationEndpoint)
      Set the authorizationEndpoint.
      Parameters:
      authorizationEndpoint - endpoint to perform authentication and authorization.
      Returns:
      Builder
    • withTokenEndpoint

      public T withTokenEndpoint(String tokenEndpoint)
      Set the tokenEndpoint.
      Parameters:
      tokenEndpoint - endpoint used to retrieve access, id, and refresh tokens.
      Returns:
      Builder
    • withUserInfoEndpoint

      public T withUserInfoEndpoint(String userInfoEndpoint)
      Set the userInfoEndpoint.
      Parameters:
      userInfoEndpoint - endpoint used to retrieve information about a particular identity.
      Returns:
      Builder
    • withIntrospectEndpoint

      public T withIntrospectEndpoint(String introspectEndpoint)
      Set the introspectEndpoint.
      Parameters:
      introspectEndpoint - endpoint used for OAuth2 token validation.
      Returns:
      Builder
    • withRedirectUri

      public T withRedirectUri(URI redirectUri)
      Set the redirectUri.
      Parameters:
      redirectUri - uri to redirect the user agent back to from the authorization server.
      Returns:
      Builder
    • withScopeDelimiter

      public T withScopeDelimiter(String scopeDelimiter)
      Set the scopeDelimiter.
      Parameters:
      scopeDelimiter - delimiter used to separate scope values in a request.
      Returns:
      Builder
    • withScope

      public T withScope(List<String> scope)
      Set the scope.
      Parameters:
      scope - scope Strings in a list.
      Returns:
      Builder
    • withBasicAuth

      public T withBasicAuth(boolean basicAuth)
      Set the basicAuth flag.
      Parameters:
      basicAuth - boolean that holds whether the client should use basic auth for authenticating with an authorization or resource server.
      Returns:
      Builder
    • withClientAuthenticationFilter

      public T withClientAuthenticationFilter(Filter filter)
      Sets the client authentication filter capable of sending authentication information to the OAuth provider.
      Parameters:
      filter - the client authentication filter capable of sending authentication information to the OAuth provider.
      Returns:
      Builder
    • withPkceMethod

      public T withPkceMethod(PkceMethod pkceMethod)
      Sets the PKCE transformation method to use.
      Parameters:
      pkceMethod - the PKCE transformation method.
      Returns:
      Builder.
    • withResponseMode

      public T withResponseMode(ResponseMode responseMode)
      Sets the response mode.
      Parameters:
      responseMode - the non-null response mode
      Returns:
      this builder