public class TestingAuthenticationToken extends AbstractAuthenticationToken
Authentication
implementation that is
designed for use whilst unit testing.
The corresponding authentication provider is TestingAuthenticationProvider
.
Constructor and Description |
---|
TestingAuthenticationToken(Object principal,
Object credentials) |
TestingAuthenticationToken(Object principal,
Object credentials,
List<GrantedAuthority> authorities) |
TestingAuthenticationToken(Object principal,
Object credentials,
String... authorities) |
Modifier and Type | Method and Description |
---|---|
Object |
getCredentials()
The credentials that prove the principal is correct.
|
Object |
getPrincipal()
The identity of the principal being authenticated.
|
equals, eraseCredentials, getAuthorities, getDetails, getName, hashCode, isAuthenticated, setAuthenticated, setDetails, toString
public TestingAuthenticationToken(Object principal, Object credentials, String... authorities)
public TestingAuthenticationToken(Object principal, Object credentials, List<GrantedAuthority> authorities)
public Object getCredentials()
Authentication
AuthenticationManager
. Callers
are expected to populate the credentials.Principal
public 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.