Just some hints:

> I used the contrib/authexternalcookie as template

Take this stuff with a grain of salt. It is not in current use by any of
the moin developers, so the code might need some work (and it would be
nice to get improved code contributed back :).

> >>> >>> Please have a look at MoinMoin/request/__init__.py:emit_http_headers.
> >>> >>>
> >>> >>>     if lkey in ['vary', 'cache-control', 'content-language', ]:
> >>> >>>
> >>> >>> These are the headers we allow multiple times and just merge their
> >>> >>> values into a single header. Please add 'set-cookie' to that list and
> >>> >>> try if that works (it won't give exceptions any more, but you have to
> >>> >>> check if BOTH cookies work correctly).
> > >
> > > Did you do that?
> >   
> yes

OK, if that worked (you got both cookies), I can commit that to the moin
repo.

> >> >> TypeError: unpack non-sequence

I bet this comes from the "return request.finish()" you have in there.

> class ExternalCookie(BaseAuth):
>     name = 'external_cookie'
>     def request(self,request,user_obj, **kw):
>         """ authenticate via external cookie """
>         import Cookie
>         cookiename = "NSFLAB" # XXX external cookie name you want to use
>         try:
>             cookie = Cookie.SimpleCookie(request.saved_cookie)
>         except Cookie.CookieError:
>             # ignore invalid cookies
>             cookie = None
>         import urllib
>         if cookie and cookie.has_key(cookiename):
>             cookievalue = cookie[cookiename].value
>             cookievalue = urllib.unquote(cookievalue)
>             cookievalue = cookievalue.decode('iso-8859-1')
>             cookievalue = cookievalue.split('|')
>         elif cookie and cookie.has_key('attESHr'):
>             cookievalue = cookie['attESHr'].value
>             cookievalue = urllib.unquote(cookievalue)
>             cookievalue = cookievalue.decode('iso-8859-1')
>             cookievalue = cookievalue.split('|')
>             userid = cookievalue[2]
>             cookievalue.append(userid.split('@')[0])
> #            f = open("cookie.log", "a")
> #            f.write("\n")
> #            f.write(repr(cookie))
> #            f.write(repr(cookievalue))
> #            f.write("\n")
> #            f.close()
>         else : #------ no cookies
>             url = hrloginurl + 'http://' + request.http_host + 
> request.request_uri
>             request.http_redirect(url)
>             return request.finish()

THIS! ^^^

BTW, you can use logging.debug("...") instead of writing your own
files. 

With 1.7.x moin's logging configuration is very flexible and you can
enable debug logging for specific modules. For temp. stuff, you can also
use logging.warning("...") which likely comes through without changing
the logging configuration.

>     auth = [ExternalCookie(),MoinAuth()]
>     cookie_domain = '.nsf.att.com'

Is the . at the beginning correct?




-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Moin-user mailing list
Moin-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/moin-user

Reply via email to