spring-security-web

org.springframework.security.web.authentication.switchuser
Class SwitchUserGrantedAuthority

java.lang.Object
  extended by org.springframework.security.web.authentication.switchuser.SwitchUserGrantedAuthority
All Implemented Interfaces:
Serializable, org.springframework.security.core.GrantedAuthority

public final class SwitchUserGrantedAuthority
extends Object
implements org.springframework.security.core.GrantedAuthority

Custom GrantedAuthority used by SwitchUserFilter

Stores the Authentication object of the original user to be used later when 'exiting' from a user switch.

Author:
Mark St.Godard
See Also:
SwitchUserFilter, Serialized Form

Constructor Summary
SwitchUserGrantedAuthority(String role, org.springframework.security.core.Authentication source)
           
 
Method Summary
 boolean equals(Object obj)
           
 String getAuthority()
           
 org.springframework.security.core.Authentication getSource()
          Returns the original user associated with a successful user switch.
 int hashCode()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SwitchUserGrantedAuthority

public SwitchUserGrantedAuthority(String role,
                                  org.springframework.security.core.Authentication source)
Method Detail

getSource

public org.springframework.security.core.Authentication getSource()
Returns the original user associated with a successful user switch.

Returns:
The original Authentication object of the switched user.

getAuthority

public String getAuthority()
Specified by:
getAuthority in interface org.springframework.security.core.GrantedAuthority

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

toString

public String toString()
Overrides:
toString in class Object

spring-security-web