Pylons AuthKit forward and RecursiveMiddleware’s ForwardRequestException
If you are running Pylons 0.9.7 with the latest “stable” AuthKit 0.4.4 you may run into some troubles using the forward AuthKit method. If you are like me, you followed all the smatterings of examples scattered about the Pylons and AuthKit site only to keep receiving a ForwardRequestException anytime you hit an authorize protected controller.
The fix is quite simple and non-existent in any of the examples that I ran across. The following line must be placed in middleware.py before the ErrorHandler and the authenticate.middleware:
app = RecursiveMiddleware(app, global_conf)
The RecursiveMiddleware will have to be imported from the paste.recursive module.
Now if I could just figure out how to redirect back to the URL that the user was trying to hit before they were forwarded through to the login screen I would be happy.
Pylons documentation hurts.
thank you!
Thank you! I would have never found it…
This helped me a lot in implementing the feature you need:
http://www.mail-archive.com/pylons-discuss@googlegroups.com/msg05755.html
Just remember that paste.recursive.old_path_info may be a list.
Regards,
Marcin
And thanks right back … your info in the discussion thread you linked to will come in handy.