-
1. Re: How to use my own Principal class?
tcherel Jul 29, 2005 4:51 AM (in response to alxll)I do not believe this is possible at this point with JBoss.
You can have a cusotm principal in your EJB code (custom principal returned by EJBContext.getCallerPrincipal), but not in the web container code.
See http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3878558 for more details, especially the last few posts of the thread referencing the http://jira.jboss.com/jira/browse/JBAS-1802 JIRA issue which is what you need in order to have your own custom principal in the web container.
Thomas -
2. Re: How to use my own Principal class?
tcherel Jul 29, 2005 4:54 AM (in response to alxll)You can probably "workaround" the problem by creating a servlet interceptor or tomcat valve to collect the user data you need and cache it as part of the HTTP session.
Not as elegant as the custom principal, I think, but that should work.
Thomas -
3. Re: How to use my own Principal class?
alxll Jul 29, 2005 7:28 AM (in response to alxll)
We've solved the problem by creating java.security.acl.group with name CallerPrincipal and value MyPrincipal instance:
Group callerPrincipal = new SimpleGroup("CallerPrincipal");
callerPrincipal.addMember(caller);
So, currently getUserPrincipal() of HttpServletRequest returns MyPrincipal instance as it required...
Anyway thanks a lot for answers!
Regards,
Alex Chesnokov -
4. Re: How to use my own Principal class?
tcherel Jul 29, 2005 8:57 AM (in response to alxll)This is definitely the way to make it work to get the custom principal in the session code, but I did not think that this was also working for the web container.
Which JBoss version are you using?
Thomas -
5. Re: How to use my own Principal class?
starksm64 Jul 30, 2005 10:49 AM (in response to alxll)The custom principal recepie works in both the ejb and web container provided that the container is doing the authentication.
http://wiki.jboss.org/wiki/Wiki.jsp?page=UsingCustomPrincpalsWith -
6. Re: How to use my own Principal class?
alxll Aug 1, 2005 12:41 PM (in response to alxll)"tcherel" wrote:
This is definitely the way to make it work to get the custom principal in the session code, but I did not think that this was also working for the web container.
Which JBoss version are you using?
Thomas
I'm using JBoss AS 4.0.2