The Source for Java Technology Collaboration

Home » java.net Forums » GlassFish » GlassFish

Thread: How does an EJB invocation from outside glassfish get assigned roles?

Welcome, Guest Help
Login Login
Guest Settings Guest Settings
This question is not answered. Helpful answers available: 2. Correct answers available: 1.

Reply to this Thread Reply to this Thread Search Forum Search Forum Back to Thread List Back to Thread List

Permlink Replies: 2 - Last Post: Sep 17, 2008 6:20 PM by: dcam
dcam

Posts: 15
How does an EJB invocation from outside glassfish get assigned roles?
Posted: Sep 16, 2008 12:46 AM
 
  Click to reply to this thread Reply

I've got a situation where one glassfish instance (external front end) hosting a web deployment is talking to another glassfish hosting ejbs and the same web deployment (internal front end).

The internal web works just fine talking to its ejbs, but the external one can't call the ejbs, although the calls are making it through to the ejb tier, the backend is refusing them with "javax.ejb.AccessLocalException: Client not authorized for this invocation" (logged in the glassfish instance hosting the ejbs).

The username of the caller (rto) is being propagated through to the backend, since the backend logs the caller name:

(principals com.sun.enterprise.deployment.PrincipalImpl "rto")

But even though the roles available at the external front end are properly assigned, the backend doesn't seem to associate the caller with the roles it is supposed to have.

The glassfish instance has activate-default-principal-to-role-mapping="true" and the grouprole mappings are also explicitly declared in the sun-ejb-jar.xml and sun-web.xml.

The backend says:

[#|2008-09-16T12:17:36.170+0930|INFO|sun-appserver9.1|javax.enterprise.system.core.security|_ThreadID=29;_ThreadName=p: thread-pool-1; w: 18;|JACC Policy Provider: PolicyWrapper.implies, context(tlc-ejb/tlc-ejb)- permission((javax.security.jacc.EJBMethodPermission UserServiceBean getUser,Remote,)) domain that failed(ProtectionDomain (file:/tlc-ejb/tlc-ejb <no signer certificates>)

I haven't found much helpful documentation on all this.

How can I make glassfish look up the groups for the user using its appropriate security module and map them to roles?

monzillo

Posts: 181
Re: How does an EJB invocation from outside glassfish get assigned roles?
Posted: Sep 16, 2008 11:04 AM   in response to: dcam
 
  Click to reply to this thread Reply

(as I think you have concluded) for the remote invocation, the web container includes an identity assertion in the rmi/iiop msg it sends to the ejb container. the identity assertion contains only the caller principal, it does not contain the caller's group principals. when the identity assertion arrives at the remote container, the caller's groups principals should be added to the security-context..but that is not happening. for a local web to ejb invocation, the security context is shared such that the groups are preserved across the network.

If you are able to include a caller based p2r mapping on the remote system, that would be one way to work-around the problem. You can see a related posting here

http://forums.java.net/jive/thread.jspa?messageID=285659

This is a known problem, and should be resolved approximately as described in the above issue. that is the realm of the receiving system should be consulted (during processing of the identity assertion) to add the appropriate groups to the security context.

There is an open Glassfish issue to fix this, see

https://glassfish.dev.java.net/issues/show_bug.cgi?id=3873

you may want to refer to it in any other posts on this problem.
I'll see if we can expedite its resolution.

thanks,

Ron

dcam

Posts: 15
Re: How does an EJB invocation from outside glassfish get assigned roles?
Posted: Sep 17, 2008 6:20 PM   in response to: monzillo
 
  Click to reply to this thread Reply

Thank you very much for your reply. It pointed me in the right direction.

I have created a patch that -seems- to solve this problem. I have attached it to the bug you link as above.




 XML java.net RSS