You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Jonathan Rosenberg <jr...@tabbysplace.org> on 2011/03/05 18:48:36 UTC

Confused by url-pattern in Contatner Managed Auth

I thought I understood how contained-managed auth worked, but
obviously I'm missing something.

Hers' what I have right now

	<security-constraint>
		<web-resource-collection>
			<web-resource-name>JDBCRealmTest</web-resource-name>
			<description>accessible by authenticated users of the
adoption-admin role</description>
			<url-pattern>/Adoption/application/list</url-pattern>
		</web-resource-collection>
		<auth-constraint>
			<description>These roles are allowed access</description>
			<role-name>adoption-admin</role-name>
		</auth-constraint>
	</security-constraint>
	<login-config>
		<auth-method>BASIC</auth-method>
		<realm-name>MyFirst Protected Area</realm-name>
	</login-config>
	<security-role>
		<description>Only ‘adoption-admin’ role is allowed to access this
web application</description>
		<role-name>adoption-admin</role-name>
	</security-role>

I thought this would require auth for the url
/Adoption/application/list, but there is no challenge when I test.  I
have fooled with the url-pattern but the only pattern I can get to
work is '/Adoption/*'.  I have tried '/Adoption',
'/Adoption/application/list/*', but none of them cause a challenge.

What am I missing?

--
Jonathan Rosenberg
Founder & Executive Director
Tabby's Place, a Cat Sanctuary
http://www.tabbysplace.org/

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


Re: Confused by url-pattern in Contatner Managed Auth

Posted by Jonathan Rosenberg <jr...@tabbysplace.org>.
>> My bet is that the webapp is deployed under "/Adoption" and therefore
>> the <url-pattern> should not have "/Adoption" prepended to it.

This was indeed the problem.  Took me awhile to figure that out.  Next
time I'll provide more info up front.

Thanks.

--
Jonathan Rosenberg
Founder & Executive Director
Tabby's Place, a Cat Sanctuary
http://www.tabbysplace.org/


On Mon, Mar 7, 2011 at 9:40 AM, Christopher Schultz
<ch...@christopherschultz.net> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Chuck,
>
> On 3/5/2011 6:26 PM, Caldarale, Charles R wrote:
>>> From: shmoldie@gmail.com [mailto:shmoldie@gmail.com] On Behalf Of Jonathan Rosenberg
>>> Subject: Confused by url-pattern in Contatner Managed Auth
>>
>>> I thought this would require auth for the url
>>> /Adoption/application/list, but there is no
>>> challenge when I test.
>>
>> Need more information: under what name is your webapp deployed, and what is the complete URL you're trying to use?
>
> +1
>
> My bet is that the webapp is deployed under "/Adoption" and therefore
> the <url-pattern> should not have "/Adoption" prepended to it.
>
> To Jonathan: all URLs within a webapp will be webapp-relative, so if you
> deploy into "/Adoption", you should never have "/Adoption" at the
> beginning of any of your URLs.
>
> - -chris
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.10 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>
> iEYEARECAAYFAk107nYACgkQ9CaO5/Lv0PDALACdHMPzj8NSKKUTO/Wy+3syyMdx
> xecAoIrEeb231UnYnimh8EV4kIZ5WteD
> =YRey
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

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


Re: Confused by url-pattern in Contatner Managed Auth

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Chuck,

On 3/5/2011 6:26 PM, Caldarale, Charles R wrote:
>> From: shmoldie@gmail.com [mailto:shmoldie@gmail.com] On Behalf Of Jonathan Rosenberg
>> Subject: Confused by url-pattern in Contatner Managed Auth
> 
>> I thought this would require auth for the url
>> /Adoption/application/list, but there is no
>> challenge when I test.
> 
> Need more information: under what name is your webapp deployed, and what is the complete URL you're trying to use?

+1

My bet is that the webapp is deployed under "/Adoption" and therefore
the <url-pattern> should not have "/Adoption" prepended to it.

To Jonathan: all URLs within a webapp will be webapp-relative, so if you
deploy into "/Adoption", you should never have "/Adoption" at the
beginning of any of your URLs.

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

iEYEARECAAYFAk107nYACgkQ9CaO5/Lv0PDALACdHMPzj8NSKKUTO/Wy+3syyMdx
xecAoIrEeb231UnYnimh8EV4kIZ5WteD
=YRey
-----END PGP SIGNATURE-----

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


RE: Confused by url-pattern in Contatner Managed Auth

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: shmoldie@gmail.com [mailto:shmoldie@gmail.com] On Behalf Of Jonathan Rosenberg
> Subject: Confused by url-pattern in Contatner Managed Auth

> I thought this would require auth for the url
> /Adoption/application/list, but there is no
> challenge when I test.

Need more information: under what name is your webapp deployed, and what is the complete URL you're trying to use?

Also, it's always a good idea to tell us what version of Tomcat you're using, what JVM you're running it on, and the platform in use.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.



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