Interface Authentication.Builder<B extends Authentication.Builder<B>>
- All Known Implementing Classes:
AbstractAuthenticationToken.AbstractAuthenticationBuilder,AbstractOAuth2TokenAuthenticationToken.AbstractOAuth2TokenAuthenticationBuilder,BearerTokenAuthentication.Builder,CasAuthenticationToken.Builder,CasServiceTicketAuthenticationToken.Builder,JaasAuthenticationToken.Builder,JwtAuthenticationToken.Builder,OAuth2AuthenticationToken.Builder,OneTimeTokenAuthentication.Builder,PreAuthenticatedAuthenticationToken.Builder,RememberMeAuthenticationToken.Builder,Saml2AssertionAuthentication.Builder,TestingAuthenticationToken.Builder,UsernamePasswordAuthenticationToken.Builder,WebAuthnAuthentication.Builder
- Enclosing interface:
- Authentication
Authentication instance- Since:
- 7.0
-
Method Summary
Modifier and TypeMethodDescriptionauthenticated(boolean authenticated) Mark this authentication as authenticated or notauthorities(Consumer<Collection<GrantedAuthority>> authorities) Mutate the authorities with thisConsumer.build()Build anAuthenticationinstancedefault Bcredentials(@Nullable Object credentials) Use this credential.Use this details object.Use this principal.
-
Method Details
-
authorities
Mutate the authorities with thisConsumer.Note that since a non-empty set of authorities implies an
Authenticationis authenticated, this method also marks the authentication asauthenticated(boolean)by default.- Parameters:
authorities- a consumer that receives the full set of authorities- Returns:
- the
Authentication.Builderfor additional configuration - See Also:
-
credentials
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
CredentialsContainerand the credentials are thereby erased.- Parameters:
credentials- the credentials to use- Returns:
- the
Authentication.Builderfor additional configuration - See Also:
-
details
Use this details object.Implementations may choose to use these
detailsin combination with any principal from the pre-existingAuthenticationinstance.- Parameters:
details- the details to use- Returns:
- the
Authentication.Builderfor additional configuration - See Also:
-
principal
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
principalin combination with any principal from the pre-existingAuthenticationinstance.- Parameters:
principal- the principal to use- Returns:
- the
Authentication.Builderfor additional configuration - See Also:
-
authenticated
Mark this authentication as authenticated or not- Parameters:
authenticated- whether this is an authenticatedAuthenticationinstance- Returns:
- the
Authentication.Builderfor additional configuration - See Also:
-
build
Authentication build()Build anAuthenticationinstance- Returns:
- the
Authenticationinstance
-