Joe, I understand your reason. My use of DWR is more conventional though and I use basic auth because it is so simple. It does not get
in the way. By the time the request gets to my web application code, there’s already an authenticated principal. My application need not be cluttered with security stuff – as with your third suggestion. On the server I use role-based auth. The sql query that
JBoss uses (as defined in login-config.xml) sorts out the roles the principal has. The DWR methods call stateless session beans where the methods are covered by <at> RolesAllowed annotations.
I’m not sure what you mean with the second suggestion.
As for your first suggestion: with a filter I think I’ll be moving away from basic authentication which I really don’t want to do.
I was hoping there was some hook through which DWR could allow me to construct the request object for it (I’d be using the jsx3.net.Request()
class from the GI framework). Something elegant, instead of hacking engine.js. But if there is no other way, I’d like to continue to use my hack, if you’re ok with it.
Regards
Johan
From: Joe Walker [mailto:joe-klYz7rYGnPJg9hUCZPvPmw@public.gmane.org]
Sent: 17 May 2008 12:58 PM
To: users-EyPigyGktj4FDOXUYO6UHQ@public.gmane.org
Subject: Re: [dwr-user] basic authentication (the right way)
The reason we've never exposed this is that DWR doesn't guarantee to use XHR. If you have an old Safari (and maybe a new Safari too), IE6 on Windows server, are using file-upload, cross-domain, or reverse ajax, then DWR may use iframe or script tags, where
the username and password don't work the same way if at all.
You can still:
- set a custom header / cookie / parameter and check in an AjaxFilter
- use cookie based auth like EE role based security
- add the auth details to an extra parameter to the called methods.
Joe.
No virus found in this outgoing message. Checked by AVG. Version: 7.5.524 / Virus Database: 269.23.20/1452 - Release Date: 2008/05/17 06:26 PM