Package io.jmix.core.security.impl
Class SubstitutedUserAuthenticationToken
java.lang.Object
org.springframework.security.authentication.AbstractAuthenticationToken
io.jmix.core.security.impl.SubstitutedUserAuthenticationToken
- All Implemented Interfaces:
- Serializable,- Principal,- org.springframework.security.core.Authentication,- org.springframework.security.core.CredentialsContainer
public class SubstitutedUserAuthenticationToken
extends org.springframework.security.authentication.AbstractAuthenticationToken
Authentication object used by the user substitution mechanism.
- See Also:
- 
Constructor SummaryConstructorsConstructorDescriptionSubstitutedUserAuthenticationToken(org.springframework.security.core.Authentication originalToken, Object substitutedPrincipal) This constructor can be safely used by any code that wishes to create aSubstitutedUserAuthenticationToken, as theAbstractAuthenticationToken.isAuthenticated()will returnfalse.SubstitutedUserAuthenticationToken(org.springframework.security.core.Authentication originalToken, Object substitutedPrincipal, Collection<? extends org.springframework.security.core.GrantedAuthority> authorities) This constructor should only be used byAuthenticationManagerorAuthenticationProviderimplementations that are satisfied with producing a trusted (i.e.
- 
Method SummaryModifier and TypeMethodDescriptionbooleaninthashCode()voidsetAuthenticated(boolean isAuthenticated) Methods inherited from class org.springframework.security.authentication.AbstractAuthenticationTokeneraseCredentials, getAuthorities, getDetails, getName, isAuthenticated, setDetails, toString
- 
Constructor Details- 
SubstitutedUserAuthenticationTokenpublic SubstitutedUserAuthenticationToken(org.springframework.security.core.Authentication originalToken, Object substitutedPrincipal) This constructor can be safely used by any code that wishes to create aSubstitutedUserAuthenticationToken, as theAbstractAuthenticationToken.isAuthenticated()will returnfalse.- Parameters:
- originalToken- token of current user
- substitutedPrincipal-- userNameof user that should be substituted
 
- 
SubstitutedUserAuthenticationTokenpublic SubstitutedUserAuthenticationToken(org.springframework.security.core.Authentication originalToken, Object substitutedPrincipal, Collection<? extends org.springframework.security.core.GrantedAuthority> authorities) This constructor should only be used byAuthenticationManagerorAuthenticationProviderimplementations that are satisfied with producing a trusted (i.e.AbstractAuthenticationToken.isAuthenticated()=true) authentication token.- Parameters:
- originalToken- to take current principal and details from
- substitutedPrincipal- principal whose authorities are used
- authorities- authorities
 
 
- 
- 
Method Details- 
getCredentials
- 
getPrincipal
- 
setAuthenticated- Specified by:
- setAuthenticatedin interface- org.springframework.security.core.Authentication
- Overrides:
- setAuthenticatedin class- org.springframework.security.authentication.AbstractAuthenticationToken
- Throws:
- IllegalArgumentException
 
- 
getSubstitutedPrincipal
- 
equals
- 
hashCodepublic int hashCode()
 
-