jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "saleh.hazrami" <saleh.hazr...@yahoo.com>
Subject problem in creating session using JAAS authenticated subject
Date Sat, 10 Mar 2012 17:14:09 GMT
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.

Mime
View raw message