Can I jump in and ask a related question? I have a very similar problem, and
are also trying to use MgnlContext.login. However, I have an external system to
authenticate me and just want Magnolia to accept me and to set the correct
roles for me. I have code looking like this in my own LoginHandler (simplified
to always login as "olamon" with role "superuser"):
Map<String, String> properties = new HashMap<String, String>();
properties.put( "name", "olamon" );
properties.put( "fullName", "Olas full name" );
properties.put( "email", "[email protected]" );
properties.put( "language", "en" );
RoleList roleList = new RoleListImpl();
roleList.add( "superuser" );
GroupList groupList = new GroupListImpl();
User user = new ExternalUserManager().getUser( properties,
groupList, roleList );
PrincipalCollection aclList = new PrincipalCollectionImpl();
aclList.setName( "PrincipalCollection" );
RoleManager rm = new MgnlRoleManager();
Map<String, ACL> acls = rm.getACLs( "superuser" );
for (Entry<String, ACL> acl : acls.entrySet()) {
aclList.add( acl.getValue() );
}
Subject subject = new Subject();
subject.getPrincipals().add( user );
subject.getPrincipals().add( roleList );
subject.getPrincipals().add( groupList );
subject.getPrincipals().add( aclList );
MgnlContext.login( subject );
return new LoginResult( LoginResult.STATUS_SUCCEEDED, subject );
But gets basically the same result. The user is logged in, but the user don't
seem to have any privileges at all.
Any idea what can be wrong?
--
Context is everything:
http://forum.magnolia-cms.com/forum/thread.html?threadId=78b2ea20-d914-4c9c-8c38-06db36bc5002
----------------------------------------------------------------
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]>
----------------------------------------------------------------