Class AbstractAuthenticationToken.AbstractAuthenticationBuilder<B extends AbstractAuthenticationToken.AbstractAuthenticationBuilder<B>>
java.lang.Object
org.springframework.security.authentication.AbstractAuthenticationToken.AbstractAuthenticationBuilder<B>
- Type Parameters:
B
-
- All Implemented Interfaces:
Authentication.Builder<B>
- Direct Known Subclasses:
AbstractOAuth2TokenAuthenticationToken.AbstractOAuth2TokenAuthenticationBuilder
,CasAuthenticationToken.Builder
,CasServiceTicketAuthenticationToken.Builder
,OAuth2AuthenticationToken.Builder
,OneTimeTokenAuthentication.Builder
,PreAuthenticatedAuthenticationToken.Builder
,RememberMeAuthenticationToken.Builder
,Saml2AssertionAuthentication.Builder
,TestingAuthenticationToken.Builder
,UsernamePasswordAuthenticationToken.Builder
,WebAuthnAuthentication.Builder
- Enclosing class:
- AbstractAuthenticationToken
protected abstract static class AbstractAuthenticationToken.AbstractAuthenticationBuilder<B extends AbstractAuthenticationToken.AbstractAuthenticationBuilder<B>>
extends Object
implements Authentication.Builder<B>
A common abstract implementation of
Authentication.Builder
. It implements
the builder methods that correspond to the Authentication
methods that
AbstractAuthenticationToken
implements- Since:
- 7.0
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
-
Method Summary
Modifier and TypeMethodDescriptionauthenticated
(boolean authenticated) Mark this authentication as authenticated or notauthorities
(Consumer<Collection<GrantedAuthority>> authorities) Mutate the authorities with thisConsumer
.Use this details object.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.security.core.Authentication.Builder
build, credentials, principal
-
Constructor Details
-
AbstractAuthenticationBuilder
-
-
Method Details
-
authenticated
Description copied from interface:Authentication.Builder
Mark this authentication as authenticated or not- Specified by:
authenticated
in interfaceAuthentication.Builder<B extends AbstractAuthenticationToken.AbstractAuthenticationBuilder<B>>
- Parameters:
authenticated
- whether this is an authenticatedAuthentication
instance- Returns:
- the
Authentication.Builder
for additional configuration - See Also:
-
details
Description copied from interface:Authentication.Builder
Use this details object.Implementations may choose to use these
details
in combination with any principal from the pre-existingAuthentication
instance.- Specified by:
details
in interfaceAuthentication.Builder<B extends AbstractAuthenticationToken.AbstractAuthenticationBuilder<B>>
- Parameters:
details
- the details to use- Returns:
- the
Authentication.Builder
for additional configuration - See Also:
-
authorities
Description copied from interface:Authentication.Builder
Mutate the authorities with thisConsumer
.Note that since a non-empty set of authorities implies an
Authentication
is authenticated, this method also marks the authentication asAuthentication.Builder.authenticated(boolean)
by default.- Specified by:
authorities
in interfaceAuthentication.Builder<B extends AbstractAuthenticationToken.AbstractAuthenticationBuilder<B>>
- Parameters:
authorities
- a consumer that receives the full set of authorities- Returns:
- the
Authentication.Builder
for additional configuration - See Also:
-