jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paco Avila <pav...@git.es>
Subject Re: Login error with null Credentials
Date Mon, 03 Apr 2006 11:48:01 GMT
El lun, 03-04-2006 a las 11:28 +0200, Paco Avila escribió:
> I hace a webapp configured with security. So I need to login on it,
> using BASIC authentication. When I do:
> 
> Repository r = (Repository) ctx.lookup("repo");
> Session session = r.login();
> 
> Jackrabbit is supposed to get credentials from the authenticated user,
> but fails.

I've been tweakin the RepositoryImpl class and changed this lines 

// null credentials, obtain the identity of the already-authenticated
// subject from access control context
AccessControlContext acc = AccessController.getContext();
Subject subject = Subject.getSubject(acc);

to:

// null credentials, obtain the identity of the already-authenticated
// subject from access control context
Context ctx = new InitialContext();
subject = (Subject)ctx.lookup("java:comp/env/security/subject"); 

And now works. But i wonder if this is a dirty patch or a good one. This
works in JBoss 4.0.3SP1.

-- 
Paco Avila <pavila@git.es>


Mime
View raw message