public class SubstitutedUserAuthenticationToken
extends org.springframework.security.authentication.AbstractAuthenticationToken
Constructor and Description |
---|
SubstitutedUserAuthenticationToken(org.springframework.security.core.Authentication originalToken,
java.lang.Object substitutedPrincipal)
This constructor can be safely used by any code that wishes to create a
SubstitutedUserAuthenticationToken , as the AbstractAuthenticationToken.isAuthenticated()
will return false . |
SubstitutedUserAuthenticationToken(org.springframework.security.core.Authentication originalToken,
java.lang.Object substitutedPrincipal,
java.util.Collection<? extends org.springframework.security.core.GrantedAuthority> authorities)
This constructor should only be used by
AuthenticationManager or
AuthenticationProvider implementations that are satisfied with
producing a trusted (i.e. |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
java.lang.Object |
getCredentials() |
java.lang.Object |
getPrincipal() |
java.lang.Object |
getSubstitutedPrincipal() |
int |
hashCode() |
void |
setAuthenticated(boolean isAuthenticated) |
eraseCredentials, getAuthorities, getDetails, getName, isAuthenticated, setDetails, toString
public SubstitutedUserAuthenticationToken(org.springframework.security.core.Authentication originalToken, java.lang.Object substitutedPrincipal)
SubstitutedUserAuthenticationToken
, as the AbstractAuthenticationToken.isAuthenticated()
will return false
.originalToken
- token of current usersubstitutedPrincipal
- userName
of user that should be substitutedpublic SubstitutedUserAuthenticationToken(org.springframework.security.core.Authentication originalToken, java.lang.Object substitutedPrincipal, java.util.Collection<? extends org.springframework.security.core.GrantedAuthority> authorities)
AuthenticationManager
or
AuthenticationProvider
implementations that are satisfied with
producing a trusted (i.e. AbstractAuthenticationToken.isAuthenticated()
= true
)
authentication token.originalToken
- to take current principal and details fromsubstitutedPrincipal
- principal whose authorities are usedauthorities
- authoritiespublic java.lang.Object getCredentials()
public java.lang.Object getPrincipal()
public void setAuthenticated(boolean isAuthenticated) throws java.lang.IllegalArgumentException
setAuthenticated
in interface org.springframework.security.core.Authentication
setAuthenticated
in class org.springframework.security.authentication.AbstractAuthenticationToken
java.lang.IllegalArgumentException
public java.lang.Object getSubstitutedPrincipal()
public boolean equals(java.lang.Object obj)
equals
in interface java.security.Principal
equals
in class org.springframework.security.authentication.AbstractAuthenticationToken
public int hashCode()
hashCode
in interface java.security.Principal
hashCode
in class org.springframework.security.authentication.AbstractAuthenticationToken