You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Cory Prowse <co...@prowse.com> on 2010/07/17 04:52:38 UTC
JAAS Subject not propagating to JCA
Hi,
I'm failing to get Jackrabbit to see a pre-authenticated Subject when deployed as a JCA Resource within Glassfishv3.
My application uses the container to authenticate users, and I can see the currently logged in user within an EJB with:
currentEJBContext.getCallerPrincipal().getName()
Alas, when I ask Jackrabbit for the UserID I always get "anonymous".
This is the method I'm using for obtaining the UserID from Jackrabbit:
public String getUserID() throws LoginException, RepositoryException {
final Session session = repository.login();
try {
return session.getUserID();
} finally {
session.logout();
}
}
My repository.xml contains the following security config:
<Security appName="Jackrabbit">
<AccessManager class="org.apache.jackrabbit.core.security.simple.SimpleAccessManager">
</AccessManager>
<LoginModule class="org.apache.jackrabbit.core.security.simple.SimpleLoginModule">
<param name="anonymousId" value="anonymous" />
</LoginModule>
</Security>
I have traced the code into the RepositoryImpl.extendAuthentication method and it seems the AccessControlContext is not propagated to the Jackrabbit JCA.
I'd really appreciate any insight into how to make this work.
-- Cory