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
ConstructorDescriptionSubstitutedUserAuthenticationToken
(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 byAuthenticationManager
orAuthenticationProvider
implementations that are satisfied with producing a trusted (i.e. -
Method Summary
Modifier and TypeMethodDescriptionboolean
int
hashCode()
void
setAuthenticated
(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
-userName
of 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 byAuthenticationManager
orAuthenticationProvider
implementations 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:
setAuthenticated
in interfaceorg.springframework.security.core.Authentication
- Overrides:
setAuthenticated
in classorg.springframework.security.authentication.AbstractAuthenticationToken
- Throws:
IllegalArgumentException
-
getSubstitutedPrincipal
-
equals
-
hashCode
public int hashCode()
-