tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Fulford, William" <William.Fulf...@ngc.com>
Subject RE: Return from getRemoteUser and isUserInRole Inconsistent
Date Mon, 25 Jan 2010 21:59:51 GMT
Chris,

Attached are the relevant sections from the server.xml and web.xml, respectively.

I'm using DWR to call Java methods in HttpServletInfo (a class I wrote) from a JavaScript
using ExtJs:

...

HttpServletInfo.getRemoteUser(function(user)
{
   ...
};

...

HttpServletInfo.isUserInRole("tgirs", function(isInRole)
{
   ...
};

...

These are called every time my page is loaded (Ext.onReady).

I've tried with or without restarting Firefox, with or without restarting Tomcat, and via
<ctrl>-<shift> Reload (Reload that clears private data).  The only consistency
is that, after restarting Tomcat, the user name is returned, and isInRole is false.  Otherwise
the results are inconsistent.

Thanks,
Doug

-----Original Message-----
From: Christopher Schultz [mailto:chris@christopherschultz.net] 
Sent: Monday, January 25, 2010 12:46 PM
To: Tomcat Users List
Subject: Re: Return from getRemoteUser and isUserInRole Inconsistent

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Doug,

On 1/25/2010 3:35 PM, Fulford, William wrote:
> I'm using Tomcat 6.0 with Firefox 3.0.12 and JNDIRealm for
> authentication.  When I call HttpServletRequest.getRemoteUser() and
> HttpServletRequest.isUserInRole(), I get inconsistent results.
> Sometimes I get null for user and other times I get the user name.
> Sometimes I get false for isUserInRole() and other times I get true.
> More often than not I get null and false, but there is no discernable
> pattern.  I always check after the user has been authenticated.  Any
> ideas?

What form of credential gathering are you using? FORM? BASIC? CLIENT-CERT?

Can you post the <security-constraint> sections of your web.xml file?

Can you post some specific examples? The return value for
HttpServletRequest.isUserInRole depends highly on the parameter passed
to it and the roles held by the currently-logged-in user.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkteAx4ACgkQ9CaO5/Lv0PBZRACeJWpje2H/EkTF2Vv4LWKAt7xQ
qPgAoL0DaUgH/PIXqc53WioMACs9X7TQ
=2HZp
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org

Mime
View raw message