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 Summary
ConstructorsConstructorDescriptionSubstitutedUserAuthenticationToken(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 Summary
Modifier and TypeMethodDescriptionbooleaninthashCode()voidsetAuthenticated(boolean isAuthenticated) Methods inherited from class org.springframework.security.authentication.AbstractAuthenticationToken
eraseCredentials, getAuthorities, getDetails, getName, isAuthenticated, setDetails, toString
-
Constructor Details
-
SubstitutedUserAuthenticationToken
public 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 usersubstitutedPrincipal-userNameof user that should be substituted
-
SubstitutedUserAuthenticationToken
public 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 fromsubstitutedPrincipal- principal whose authorities are usedauthorities- authorities
-
-
Method Details
-
getCredentials
-
getPrincipal
-
setAuthenticated
- Specified by:
setAuthenticatedin interfaceorg.springframework.security.core.Authentication- Overrides:
setAuthenticatedin classorg.springframework.security.authentication.AbstractAuthenticationToken- Throws:
IllegalArgumentException
-
getSubstitutedPrincipal
-
equals
-
hashCode
public int hashCode()
-