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, waitMethods inherited from interface org.springframework.security.core.Authentication.Builder
build, credentials, principal
-
Constructor Details
-
AbstractAuthenticationBuilder
-
-
Method Details
-
authenticated
Description copied from interface:Authentication.BuilderMark this authentication as authenticated or not- Specified by:
authenticatedin interfaceAuthentication.Builder<B extends AbstractAuthenticationToken.AbstractAuthenticationBuilder<B>>- Parameters:
authenticated- whether this is an authenticatedAuthenticationinstance- Returns:
- the
Authentication.Builderfor additional configuration - See Also:
-
details
Description copied from interface:Authentication.BuilderUse this details object.Implementations may choose to use these
detailsin combination with any principal from the pre-existingAuthenticationinstance.- Specified by:
detailsin interfaceAuthentication.Builder<B extends AbstractAuthenticationToken.AbstractAuthenticationBuilder<B>>- Parameters:
details- the details to use- Returns:
- the
Authentication.Builderfor additional configuration - See Also:
-
authorities
Description copied from interface:Authentication.BuilderMutate the authorities with thisConsumer.Note that since a non-empty set of authorities implies an
Authenticationis authenticated, this method also marks the authentication asAuthentication.Builder.authenticated(boolean)by default.- Specified by:
authoritiesin interfaceAuthentication.Builder<B extends AbstractAuthenticationToken.AbstractAuthenticationBuilder<B>>- Parameters:
authorities- a consumer that receives the full set of authorities- Returns:
- the
Authentication.Builderfor additional configuration - See Also:
-