You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@shiro.apache.org by "romulolana@mp.mg.gov.br" <ro...@mp.mg.gov.br> on 2011/10/01 01:34:13 UTC

RE: How to include aditional fields in Authenticated User?

Do you have some examples of how I could include this information in the
Subject's PrincipalCollection?

I was trying the following approach: 
I tried to override the queryForAuthenticationInfo adding the following
code:

Subject currentUser = SecurityUtils.getSubject();
Session session = currentUser.getSession();
UserProfile userProfile = new UserProfile();
userProfile = LdapUtil.loadProfile(ctx);		
session.setAttribute( "userProfile", userProfile );

Basically, I put the profile in the user's session to be retrieved later if
necessary.

At the first time the login the profile was loaded. But after logout and
login again the profile wasn't loaded, maybe because I'm using the cache,
and the code isn't run in the second execution.

Do you know where is the best place to implement this functionality?

Thanks in advance,

RĂ´mulo Cordeiro Lana   
Systems Analyst - Public Prosecutor of the State of Minas Gerais
IT Superintendent - Information Systems - System Architecture
Tel.: (+55 31) 33308340 - romulolana@mp.mg.gov.br



--
View this message in context: http://shiro-user.582556.n2.nabble.com/How-to-include-aditional-fields-in-Authenticated-User-tp6848837p6849518.html
Sent from the Shiro User mailing list archive at Nabble.com.