Class UsernamePasswordAuthenticationToken.Builder<B extends UsernamePasswordAuthenticationToken.Builder<B>>
java.lang.Object
org.springframework.security.authentication.AbstractAuthenticationToken.AbstractAuthenticationBuilder<B>
org.springframework.security.authentication.UsernamePasswordAuthenticationToken.Builder<B>
- All Implemented Interfaces:
- Authentication.Builder<B>
- Direct Known Subclasses:
- JaasAuthenticationToken.Builder
- Enclosing class:
- UsernamePasswordAuthenticationToken
public static class UsernamePasswordAuthenticationToken.Builder<B extends UsernamePasswordAuthenticationToken.Builder<B>>
extends AbstractAuthenticationToken.AbstractAuthenticationBuilder<B>
A builder of 
UsernamePasswordAuthenticationToken instances- Since:
- 7.0
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionbuild()Build anAuthenticationinstancecredentials(@Nullable Object credentials) Use this credential.Use this principal.Methods inherited from class org.springframework.security.authentication.AbstractAuthenticationToken.AbstractAuthenticationBuilderauthenticated, authorities, details
- 
Constructor Details- 
Builder
 
- 
- 
Method Details- 
principalDescription copied from interface:Authentication.BuilderUse 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:
 
- 
credentialsDescription copied from interface:Authentication.BuilderUse 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:
 
- 
buildDescription copied from interface:Authentication.BuilderBuild anAuthenticationinstance- Returns:
- the Authenticationinstance
 
 
-