Now the load of user's profile is functioning...
The solution:
For documentation I extended org.apache.shiro.realm.ldap.JndiLdapRealm and
overrided the createAuthenticationInfo and I created a class UserProfile
that implements Comparable<UserProfile>, Principal, Serializable.
The method implemented:
@Override
@SuppressWarnings({"UnusedDeclaration"})
protected AuthenticationInfo
createAuthenticationInfo(AuthenticationToken token, Object ldapPrincipal,
Object
ldapCredentials, LdapContext ldapContext)throws NamingException {
System.out.println("createAuthenticationInfo");
// **** LOAD USER PROFILE
UserProfile userProfile = new UserProfile();
userProfile =
LdapUtil.loadProfile(ldapContext,(String)token.getPrincipal());
System.out.println("Profile loaded...");
userProfile.show();
return new SimpleAuthenticationInfo(userProfile,
token.getCredentials(), getName());
}
--
View this message in context:
http://shiro-user.582556.n2.nabble.com/How-to-put-user-profile-in-Shiro-session-with-cache-enabled-tp6856044p6859843.html
Sent from the Shiro User mailing list archive at Nabble.com.