You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by "saleh.hazrami" <sa...@yahoo.com> on 2012/03/10 18:14:09 UTC

problem in creating session using JAAS authenticated subject

Hello All,

I have the below piece of code which works only for simpleLoginModule. The
problem with the below code is once the session is created no matter what
the userID was, the session.getUserID() returns "anonymous".

But I want the session.getUserID() to return the exact user name by which
the JAAS authentication had occurred and also the roles.

I am not able to create a session when I use the defaultLoginModule

PrivilegedAction action = new PrivilegedAction() {
            public Object run() {
                try {
                    return repository.login();
                } catch (Exception e) {
                    throw new RuntimeException(e);
                }
            }
        };
        
	session = (Session) Subject.doAs(authSubject,action);
        System.out.println(session.getUserID());


Please suggest me some way to achieve it.

Thanks!
Saleh

 



--
View this message in context: http://jackrabbit.510166.n4.nabble.com/problem-in-creating-session-using-JAAS-authenticated-subject-tp4462476p4462476.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.