You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Gary Weaver <ga...@duke.edu> on 2008/02/07 15:45:37 UTC
in Tomcat container-based authN is there a way to redirect logins
to a URL?
Hello!
I'm having trouble finding a way (maybe it is because it isn't
possible?) of making Tomcat send users to the relative URL
"/Shibboleth.sso/Login" (not served by Tomcat) in order to login if the
Tomcat session times out, etc.
Is there a way to do that?
Basically the intent is that it would be a workaround for an issue we're
having. Typically when I use the Shibboleth protected web application,
apache intercepts attempts to access the web app (via mod_shib) and
Shibboleth handles all of the authN and passes REMOTE_USER header to
Tomcat (via mod_jk) after which I am already authenticated to Bedework
(which uses Tomcat container-based auth). However, when some other users
try to access that same web application, they are consistently sent to
Tomcat's grey login screen (which doesn't use Shib, so it won't
recognize their user). When I leave my browser open too long (like
overnight), I also see the same issue. I tried changing Tomcat's
session-timeout to 1 minute (and restarting Tomcat) and authenticating
and then waiting a few minutes and trying to access the web application
again to see if it was that, but that didn't cause any problem. Mike
Douglass of Bedework suggested that I try disabling container-based
authN, so I tried commenting out the security-contraints, login-config,
and security-roles of the web.xml of the webapp that showed this
behavior (and rebuilt, redeployed, restarted Tomcat) and I was still
able to login via Shibboleth, but now the two users that consistently
are able to reproduce the issue got "Exception: Null user parameter for
public admin." in the Bedework app, and I get the same error now if I
leave my browser open overnight and try to access the web application.
I would think that if it were possible to configure Tomcat to redirect
to Shibboleth's login, that might be the best option. Does anyone know
of a way to redirect Tomcat to point at some other URL, specifically the
relative URL "/Shibboleth.sso/Login" (not served by Tomcat)?
Thanks in advance,
--
Gary Weaver
Internet Framework Services
Office of Information Technology
Duke University
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: in Tomcat container-based authN is there a way to redirect logins to a URL?
Posted by Bill Barker <wb...@wilshire.com>.
"Christopher Schultz" <ch...@christopherschultz.net> wrote in message
news:47AB2B45.2020003@christopherschultz.net...
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Gary,
>
> Gary Weaver wrote:
> | I get the following error, because those two page elements are relative
> | to the webapp and not to the host part of the URL:
> |
> | HTTP Status 404 - /caladmin/Shibboleth.sso/Login
>
> :(
>
> Yeah, the spec says:
>
> "The form-login-page element defines the location in the web
> ~ app where the page that can be used for login can be
> ~ found. The path begins with a leading / and is interpreted
> ~ relative to the root of the WAR."
>
But more importantly, TC 5.5.x will do a forward to the login page, so it
has to be served by Tomcat.
> Okay, there's one more trick you can try. Keep the form-login-config the
> way you have it in web.xml and add a filter (which may not work,
> either). Write a filter that always redirects to "/Shibboleth.sso/Login"
> (without adding the webapp's context path) no matter what, and install
> it so that it intercepts requests to "/Shibboleth.sso/Login" (which will
> include the context path).
>
This should work, but you need to configure it so that it intercepts
forwards as well as top-level requests.
> If it works, it will take a request to /caladmin/Shibboleth.sso/Login
> (which is what Tomcat's authenticator generates) and perform a redirtect
> to the URL that you really want.
>
> A little hack-y, but it might work.
>
> Another non-filter option would be to create a JSP for the login that
> performs the redirect. That might be a bit cleaner because the logic
> will be easier to follow (rather than having to simply know that there's
> a filter out there doing evil things).
>
Actually, this is a little hack-y too. Shibboleth would need to redirect to
j_security_check if the app ever POSTs to a restricted page in order to
replay the request with the original request body.
> Hope that helps,
> - -chris
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.8 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iEYEARECAAYFAkerK0UACgkQ9CaO5/Lv0PADVACgjSUmiRY024lWZohxeG1UuHtI
> cfMAoKGEct0vIG6Cnh5WJNMmyTyyi6R9
> =nuVm
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: in Tomcat container-based authN is there a way to redirect logins
to a URL?
Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Gary,
Gary Weaver wrote:
| I get the following error, because those two page elements are relative
| to the webapp and not to the host part of the URL:
|
| HTTP Status 404 - /caladmin/Shibboleth.sso/Login
:(
Yeah, the spec says:
"The form-login-page element defines the location in the web
~ app where the page that can be used for login can be
~ found. The path begins with a leading / and is interpreted
~ relative to the root of the WAR."
Okay, there's one more trick you can try. Keep the form-login-config the
way you have it in web.xml and add a filter (which may not work,
either). Write a filter that always redirects to "/Shibboleth.sso/Login"
(without adding the webapp's context path) no matter what, and install
it so that it intercepts requests to "/Shibboleth.sso/Login" (which will
include the context path).
If it works, it will take a request to /caladmin/Shibboleth.sso/Login
(which is what Tomcat's authenticator generates) and perform a redirtect
to the URL that you really want.
A little hack-y, but it might work.
Another non-filter option would be to create a JSP for the login that
performs the redirect. That might be a bit cleaner because the logic
will be easier to follow (rather than having to simply know that there's
a filter out there doing evil things).
Hope that helps,
- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAkerK0UACgkQ9CaO5/Lv0PADVACgjSUmiRY024lWZohxeG1UuHtI
cfMAoKGEct0vIG6Cnh5WJNMmyTyyi6R9
=nuVm
-----END PGP SIGNATURE-----
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: in Tomcat container-based authN is there a way to redirect logins
to a URL?
Posted by Gary Weaver <ga...@duke.edu>.
Chris,
In the version of Tomcat I'm using 5.5.25, when I do what you are
suggesting, and set the config to:
<login-config>
<auth-method>FORM</auth-method>
<realm-name>demo</realm-name>
<form-login-config>
<form-login-page>/Shibboleth.sso/Login</form-login-page>
<form-error-page>/Shibboleth.sso/Login</form-error-page>
</form-login-config>
</login-config>
I get the following error, because those two page elements are relative
to the webapp and not to the host part of the URL:
HTTP Status 404 - /caladmin/Shibboleth.sso/Login
------------------------------------------------------------------------
*type* Status report
*message* _/caladmin/Shibboleth.sso/Login_
*description* _The requested resource (/caladmin/Shibboleth.sso/Login)
is not available._
------------------------------------------------------------------------
Apache Tomcat/5.5.25
I need it to redirect to /Shibboleth.sso/Login instead of
/(webapp)/Shibboleth.sso/Login. Any idea how I could do that in Tomcat
5.5.x?
Thanks!
Gary
Christopher Schultz wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Gary,
>
> Gary Weaver wrote:
> | I'm having trouble finding a way (maybe it is because it isn't
> | possible?) of making Tomcat send users to the relative URL
> | "/Shibboleth.sso/Login" (not served by Tomcat) in order to login if
> | the Tomcat session times out, etc.
>
> Does it work to simply make your application's <form-login-page> point
> to /Shibboleth.sso/Login? If you do that, what happens?
>
> | Does anyone know of a way to redirect Tomcat to point at some other
> | URL, specifically the relative URL "/Shibboleth.sso/Login" (not
> | served by Tomcat)?
>
> I think some versions of Tomcat do a server-side forward when the login
> form is required, while other versions will do a redirect. If you can
> get Tomcat to do a redirect, this ought to work. If it's attempting to
> do a server-side forward, you may have to take other steps.
>
> - -chris
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.8 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iEYEARECAAYFAkerHjgACgkQ9CaO5/Lv0PDEewCgsaWxeBEsPBa8VLQ4Ut8Y687c
> 5gYAn2IC0OWh7LTtZMq01y5jB07YI+Xp
> =cEAC
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
--
Gary Weaver
Internet Framework Services
Office of Information Technology
Duke University
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org
Re: in Tomcat container-based authN is there a way to redirect logins
to a URL?
Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Gary,
Gary Weaver wrote:
| I'm having trouble finding a way (maybe it is because it isn't
| possible?) of making Tomcat send users to the relative URL
| "/Shibboleth.sso/Login" (not served by Tomcat) in order to login if
| the Tomcat session times out, etc.
Does it work to simply make your application's <form-login-page> point
to /Shibboleth.sso/Login? If you do that, what happens?
| Does anyone know of a way to redirect Tomcat to point at some other
| URL, specifically the relative URL "/Shibboleth.sso/Login" (not
| served by Tomcat)?
I think some versions of Tomcat do a server-side forward when the login
form is required, while other versions will do a redirect. If you can
get Tomcat to do a redirect, this ought to work. If it's attempting to
do a server-side forward, you may have to take other steps.
- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAkerHjgACgkQ9CaO5/Lv0PDEewCgsaWxeBEsPBa8VLQ4Ut8Y687c
5gYAn2IC0OWh7LTtZMq01y5jB07YI+Xp
=cEAC
-----END PGP SIGNATURE-----
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org