Greg Wilkins wrote:

> Well firstly I'm going to say that we have been having problems
> with jboss role based authentication for some time.     It is not
> something that we want to get wrong, so I think the time has long
> since passed where we need a good set of regression tests for
> this.
>
> Now, while I can see that subsequent requests will be in different
> threads - I cannot see where the second thread is coming from
> within the same request????
>
> Nowhere in the Jetty handling or the JBoss adaptor is a new thread
> created, let alone for a call to the authentication API?

Likewise, I do not create any extra threads in the integration code. Perhaps the
Servlet itself is creating it ? Is it demonstrating programmatic security rather
than declarative ? If so, then this is a problem, unless security info attached to
primary request threads can be transparently inherited, in user code, by it's
child threads....


Jules

>
>
> As the JBoss JaasSecurityManager class appears to use ThreadLocals
> to store authentication results then the solution may have to be to
> authenticate every request rather than just relying on the contents
> of a session to show that it has previously been authenticated.
>
> Note this probably means that we also have to deauthenticate threads when
> they are returned to the thread pool.    I can't see how Jetty can help
> much here, as ThreadLocals are beyond it's control and can't
> be cleared by it.     I would say that adorning Threads with security
> priviledges does not sound too robust in any environment that uses
> thread pools (Ie almost any servlet container).
>
> I don't know enough about the jboss authentication mechanism to really
> comment more - but I'll repeat that we should make security issues top
> priority.
>
> regards
>
> Julian Gosnell wrote:
>
> > Anatoly,
> >
> > Thanks for the precise description of the problem. I shall take a look at
> > this as soon as I find the time. Probably during the first week of Jan or so.
> >
> > Greg,
> >
> > Any thoughts about this before I plunge in ?
> >
> > Jules
> >
> >
> > Anatoly Akkerman wrote:
> >
> >
> >>Hi, guys
> >>
> >>I am running into problems with Jetty + JBoss 3.0alpha
> >>
> >>After some debugging here is what I have.
> >>
> >>Setup:
> >>Jetty + JBoss 3.0
> >>Sun's Petstore 1.1.1 deployed piecewise (meaning each EJB and WAR are
> >>packaged separately and deployed in a J2eeScopedDeployer)
> >>JBossSX configured to pick up usernames, password and roles from files
> >>
> >>Here is what happens:
> >>
> >>1) a servlet in Petstore takes username and password from a Web form and
> >>sets "j_username" and "j_password" in the session. Jetty seems to pick
> >>this stuff up and pass it to JBossUserRealm to authenticate the user.
> >>JbossUserPrincipal gets created and then proceeds to authenticate with
> >>with _securityMgr (which is JaasSecurityManager "java:/jaas/other").
> >>Authentication succeeds, I see a log and I did doublecheck that
> >>JaasSecurityManager sets activeSubject to this authenticated subject.
> >>
> >>2) Then, it seems, Jetty proceeds to check that this user has required
> >>roles. It first calls JbossUserRealm.getUser(name) to obtain the
> >>JBossUserPricipal and then calls isUserInRole(String role). This is where
> >>the stuff fails miserably. The reason being that Jetty dispatched a
> >>different thread to do role checking than the one that did
> >>authentication. Because of this, JaasSecurityManager sees a null
> >>activeSubject and says that the user does not have required roles.
> >>
> >>Now, this happens in a _single_ http request from a web client (just
> >>clicked 'login' button on a form). I can try hacking a workaround just for
> >>my demo to work but would like to help fixing this if it is a bug.
> >>
> >>-------------------------------------------------------------------------
> >>Anatoly Akkerman
> >>Computer Science Dept.
> >>Courant Institute of Mathematical Sciences, NYU
> >>715 Broadway, #719                      Tel: 212 998-3493
> >>New York, NY 10003                      Fax: 212 995-4123
> >>-------------------------------------------------------------------------
> >>
> >>_______________________________________________
> >>Jboss-development mailing list
> >>[EMAIL PROTECTED]
> >>https://lists.sourceforge.net/lists/listinfo/jboss-development
> >>
> >
> >
> > _________________________________________________________
> > Do You Yahoo!?
> > Get your free @yahoo.com address at http://mail.yahoo.com
> >
> >
> >
> > For the latest information about Jetty, please see http://jetty.mortbay.
> >
> > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
> >
> >
>
> --
> Greg Wilkins<[EMAIL PROTECTED]>          GB  Phone: +44-(0)7092063462
> Mort Bay Consulting Australia and UK.    Mbl Phone: +61-(0)4 17786631
> http://www.mortbay.com                   AU  Phone: +61-(0)2 98107029
>
> ------------------------ Yahoo! Groups Sponsor ---------------------~-->
> FREE COLLEGE MONEY
> CLICK HERE to search
> 600,000 scholarships!
> http://us.click.yahoo.com/G_L2TD/4m7CAA/ySSFAA/CefplB/TM
> ---------------------------------------------------------------------~->
>
> For the latest information about Jetty, please see http://jetty.mortbay.
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to