public class BearerTokenAuthenticationToken extends AbstractAuthenticationToken
Authentication
that contains a
Bearer
Token.
Used by BearerTokenAuthenticationFilter
to prepare an authentication attempt
and supported by JwtAuthenticationProvider
.Constructor and Description |
---|
BearerTokenAuthenticationToken(java.lang.String token)
Create a
BearerTokenAuthenticationToken using the provided parameter(s) |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
getCredentials()
The credentials that prove the principal is correct.
|
java.lang.Object |
getPrincipal()
The identity of the principal being authenticated.
|
java.lang.String |
getToken()
Get the
Bearer
Token
|
equals, eraseCredentials, getAuthorities, getDetails, getName, hashCode, isAuthenticated, setAuthenticated, setDetails, toString
public BearerTokenAuthenticationToken(java.lang.String token)
BearerTokenAuthenticationToken
using the provided parameter(s)token
- - the bearer tokenpublic java.lang.String getToken()
HttpServletRequest
public java.lang.Object getCredentials()
Authentication
AuthenticationManager
. Callers
are expected to populate the credentials.Principal
public java.lang.Object getPrincipal()
Authentication
The AuthenticationManager implementation will often return an
Authentication containing richer information as the principal for use by
the application. Many of the authentication providers will create a
UserDetails
object as the principal.
Principal
being authenticated or the authenticated
principal after authentication.