jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cory Prowse <c...@prowse.com>
Subject JAAS Subject not propagating to JCA
Date Sat, 17 Jul 2010 02:52:38 GMT
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
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message