Hi Dick,

If you have the Acegi source code available, you can look at the
<code>private Authentication getSourceAuthentication(Authentication
current)  </code>  method..

It basically iterates through the current Authentication object and get the
source from the SwitchUserGrantedAuthority

i.e.

       // iterate over granted authorities and find the 'switch user'
authority
       GrantedAuthority[] authorities = current.getAuthorities();

       for (int i = 0; i < authorities.length; i++) {
           // check for switch user type of authority
           if (authorities[i] instanceof SwitchUserGrantedAuthority) {
               original = ((SwitchUserGrantedAuthority)
authorities[i]).getSource();
               logger.debug("Found original switch user granted authority
[" + original + "]");
           }
       }


Cheers
Mark


On 5/8/07, Dick Weisinger <[EMAIL PROTECTED]> wrote:

 I've started using a SwitchUserProcessingFilter.

It seems to be working and it seems like I can nest the 'switches' which
is nice.

How do I get the path of switches?  The document says:



"On successful switch, the user's SecurityContextHolder will be updated to
reflect the specified user and will also contain an additional
SwitchUserGrantedAuthority<http://www.acegisecurity.org/multiproject/acegi-security/apidocs/org/acegisecurity/ui/switchuser/SwitchUserGrantedAuthority.html>which
 contains the original user."



How can I get the UserDetails for the previous (original) user(s)'s
information?

Is there a method on SecurityContextHolder ?

Is the data held as an array?



Thanks

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Home: http://acegisecurity.org
Acegisecurity-developer mailing list
Acegisecurity-developer@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/acegisecurity-developer


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Home: http://acegisecurity.org
Acegisecurity-developer mailing list
Acegisecurity-developer@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/acegisecurity-developer

Reply via email to