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:
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.springframework.security.authentication.AbstractAuthenticationToken

    org.springframework.security.authentication.AbstractAuthenticationToken.AbstractAuthenticationBuilder<B extends org.springframework.security.authentication.AbstractAuthenticationToken.AbstractAuthenticationBuilder<B>>

    Nested classes/interfaces inherited from interface org.springframework.security.core.Authentication

    org.springframework.security.core.Authentication.Builder<B extends org.springframework.security.core.Authentication.Builder<B>>
  • Constructor Summary

    Constructors
    Constructor
    Description
    SubstitutedUserAuthenticationToken(org.springframework.security.core.Authentication originalToken, 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, Object substitutedPrincipal, 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.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
     
     
     
    int
     
    void
    setAuthenticated(boolean isAuthenticated)
     

    Methods inherited from class org.springframework.security.authentication.AbstractAuthenticationToken

    eraseCredentials, getAuthorities, getDetails, getName, isAuthenticated, setDetails, toString

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.springframework.security.core.Authentication

    toBuilder

    Methods inherited from interface java.security.Principal

    implies
  • 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 a SubstitutedUserAuthenticationToken, as the AbstractAuthenticationToken.isAuthenticated() will return false.
      Parameters:
      originalToken - token of current user
      substitutedPrincipal - 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 by AuthenticationManager or AuthenticationProvider implementations 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

      public Object getCredentials()
    • getPrincipal

      public Object getPrincipal()
    • setAuthenticated

      public void setAuthenticated(boolean isAuthenticated) throws IllegalArgumentException
      Specified by:
      setAuthenticated in interface org.springframework.security.core.Authentication
      Overrides:
      setAuthenticated in class org.springframework.security.authentication.AbstractAuthenticationToken
      Throws:
      IllegalArgumentException
    • getSubstitutedPrincipal

      public Object getSubstitutedPrincipal()
    • equals

      public boolean equals(Object obj)
      Specified by:
      equals in interface Principal
      Overrides:
      equals in class org.springframework.security.authentication.AbstractAuthenticationToken
    • hashCode

      public int hashCode()
      Specified by:
      hashCode in interface Principal
      Overrides:
      hashCode in class org.springframework.security.authentication.AbstractAuthenticationToken