PDA

View Full Version : Acegi not passing all cookies



robertdale
Aug 22nd, 2008, 10:33 AM
I'm using Acegi 1.0.3 (and I'm stuck on this version because it comes from another party). I'm trying to get to cookies set by OpenSSO, however they don't seem to make it from Tomcat (5.5.26) to Acegi.

Tomcat RequestDumper shows my cookies (and I have other apps in the container working):
Aug 22, 2008 10:42:21 AM org.apache.catalina.valves.RequestDumperValve invoke
INFO: cookie=JSESSIONID=9CF61C78BF978716AE01B96E972FB470
INFO: cookie=amlbcookie=01
INFO: cookie=iPlanetDirectoryPro=AQIC5wM2LY4SfcyozmQVeJq AaMnyM2wn1xfuoSaA5%2Bxqm1k%3D%40AAJTSQACMDE%3D%23

When I print out the cookies from request passed to the ProcessingFilter, I get only:
DEBUG, http-9443-Processor25, HttpUtil.printCookies: name: JSESSIONID, domain: null, path: null, value: 9CF61C78BF978716AE01B96E972FB470, secure: false, maxAge: -1, version: 0, comment null:

Do I have to do something special to get the other cookies?
Is there some configuration I'm missing?? :confused:

The code is simply:

public class OpenSsoProcessingFilter extends AbstractProcessingFilter {

public Authentication attemptAuthentication(HttpServletRequest request) throws AuthenticationException {
Authentication result = null;

if (log.isDebugEnabled()) {
HttpUtil.printCookies(request);
}
// This always fails because we can't seem to get the iPlanetDirectoryPro cookie
SSOToken token = getToken(request);
...

Thanks,
Robert Dale

robertdale
Aug 22nd, 2008, 12:02 PM
I don't know what you guys do to the request when you wrap it, but if I unwrap it down to the original request, I can get all my cookies. Mmm.. cookies..

jswann
Apr 7th, 2009, 02:50 PM
If you don't mind me asking, how were you using OpenSSO? I'm trying to use OppenSSO and its agent. I have created a custom entry point and processing filter that will redirect to the OpenSSO Server when the user does not have a vaild security context.

Spring redirects to OpenSSO properly, but when OpenSSO redirects back to my appliaction, via the goto url param, the filter isn't able to find any of the header params set by OpenSSO.

robertdale
Apr 8th, 2009, 08:27 PM
The code and example xml configuration is available at OpenSSO extensions... https://opensso.dev.java.net/source/browse/opensso/extensions/springprovider/

Unwrapping the request to get to the raw goodies is done in https://opensso.dev.java.net/source/browse/opensso/extensions/springprovider/src/main/java/com/sun/identity/provider/spring/HttpUtil.java?rev=1.1&view=markup

The login filter is here... https://opensso.dev.java.net/source/browse/opensso/extensions/springprovider/src/main/java/com/sun/identity/provider/spring/OpenSsoProcessingFilter.java?rev=1.1&view=markup

There's a spring 2.0 provider elsewhere on the site.. https://opensso.dev.java.net/source/browse/opensso/extensions/spring2provider/