Class AbstractOAuth2TokenAuthenticationToken.AbstractOAuth2TokenAuthenticationBuilder<T extends OAuth2Token,B extends AbstractOAuth2TokenAuthenticationToken.AbstractOAuth2TokenAuthenticationBuilder<T,B>>

java.lang.Object
org.springframework.security.authentication.AbstractAuthenticationToken.AbstractAuthenticationBuilder<B>
org.springframework.security.oauth2.server.resource.authentication.AbstractOAuth2TokenAuthenticationToken.AbstractOAuth2TokenAuthenticationBuilder<T,B>
Type Parameters:
B -
All Implemented Interfaces:
Authentication.Builder<B>
Direct Known Subclasses:
BearerTokenAuthentication.Builder, JwtAuthenticationToken.Builder
Enclosing class:
AbstractOAuth2TokenAuthenticationToken<T extends OAuth2Token>

public abstract static class AbstractOAuth2TokenAuthenticationToken.AbstractOAuth2TokenAuthenticationBuilder<T extends OAuth2Token,B extends AbstractOAuth2TokenAuthenticationToken.AbstractOAuth2TokenAuthenticationBuilder<T,B>> extends AbstractAuthenticationToken.AbstractAuthenticationBuilder<B>
A builder for AbstractOAuth2TokenAuthenticationToken implementations
Since:
7.0
  • Constructor Details

  • Method Details

    • principal

      public B principal(@Nullable Object principal)
      Description copied from interface: Authentication.Builder
      Use this principal.

      Note that in many cases, the principal is strongly-typed. Implementations may choose to do a type check and are not necessarily expected to allow any object as a principal.

      Implementations may choose to use this principal in combination with any principal from the pre-existing Authentication instance.

      Parameters:
      principal - the principal to use
      Returns:
      the Authentication.Builder for additional configuration
      See Also:
    • credentials

      public B credentials(@Nullable Object credentials)
      Description copied from interface: Authentication.Builder
      Use this credential.

      Note that since some credentials are insecure to store, this method is implemented as unsupported by default. Only implement or use this method if you support secure storage of the credential or if your implementation also implements CredentialsContainer and the credentials are thereby erased.

      Parameters:
      credentials - the credentials to use
      Returns:
      the Authentication.Builder for additional configuration
      See Also:
    • token

      public B token(T token)
      The OAuth 2.0 Token to use
      Parameters:
      token - the token to use
      Returns:
      the Authentication.Builder for further configurations