Thanks for the answer. Sadly it seems that your code is turbogears - or maybe repoze - specific. I don't think I could adapt it to my needs.
On Jan 4, 1:35 pm, Alessandro Molina <[email protected]> wrote: > It was a TG2 application so I don't know if it might help you, but we > were able to solve the problem by passing the cookie as an argument to > the upload method and then fetching the authenticated user > corresponding to the cookie with the following code: > > if kw.has_key('authtkt'): > from paste.auth import auth_tkt > > #repoze.who is configure to do not use the remote address > remote_addr = '0.0.0.0' > #repoze.cookie secret is defined in config/app_cfg.py > cookie_secret = "you_cookie_secret" > > try: > timestamp, userid, tokens, user_data = > auth_tkt.parse_ticket(cookie_secret, kw.get('authtkt'), remote_addr) > user = DBSession.query(User).filter_by(user_name=userid).one() > except: > user = None -- You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en.
