Hi all
Under config.server.security.userManagers.external I have the defined
info.magnolia.cms.security.ExternalUserManager and in my jaas.config I defined
the info.magnolia.jaas.sp.ldap.ADAuthenticationModule to do the authentication.
I see that in the setEntity() method of LDAPAuthenticationModule.java which is
a subclass of ADAuthenticationModule.java lots of properties are set.
[code] final Entity user = new EntityImpl();
user.addProperty(Entity.NAME, this.name);
user.addProperty(Entity.PASSWORD, new String(this.pswd));
addUserProperties(user, attributeMap);[/code]
and in the addUserProperties method
[code] user.addProperty(Entity.EMAIL,
props.getSingleValueProperty(AttributeMap.MAIL));
user.addProperty(Entity.FULL_NAME,
props.getSingleValueProperty(AttributeMap.COMMON_NAME));[/code]
I'm interested in the FULL_NAME property. I want to get that for the currently
signed in user. The only thing stored in Magnolia are the groups and roles,
which match the AD structure. Users get the Roles assigned according to the
matching groups.
Now the big final question :) How do I get that user property FULL_NAME?
Because using the ExternalUserManager I need to have a "subject" to be able to
access that property. If I only know the username I have to use the method
which is not implemented yet.
[code] public User getUser(String name) throws UnsupportedOperationException
{
// we only support accessing current User object
// - implement source specific UserManager if needed
if (name.equalsIgnoreCase(MgnlContext.getUser().getName())) {
return MgnlContext.getUser();
}
throw new UnsupportedOperationException("not implemented yet");
}
/**
* Initialize new user using JAAS authenticated/authorized subject.
* @param subject
* @throws UnsupportedOperationException
*/
public User getUser(Subject subject) throws UnsupportedOperationException {
return new ExternalUser(subject);
}[/code]
The question is, where do I get this "subject" from? So that i can call
[code]SecuritySupport.Factory.getInstance().getUserManager("external").getUser(subject).getProperty(Entity.FULL_NAME);[/code]
Any hints on how to get to this property would be greatly appreciated :D
Thanks
--
Context is everything:
http://forum.magnolia-cms.com/forum/thread.html?threadId=40c34475-96b2-4360-8f0f-bfc7cf7cc617
----------------------------------------------------------------
For list details, see http://www.magnolia-cms.com/community/mailing-lists.html
Alternatively, use our forums: http://forum.magnolia-cms.com/
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------