Pylons AuthKit forward and RecursiveMiddleware’s ForwardRequestException

2009 July 26
by kevin

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.

3 Responses leave one →
  1. 2009 July 27
    hogeasdf permalink

    thank you!

  2. 2009 September 29
    arag0rn permalink

    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

  3. 2009 October 9

    And thanks right back … your info in the discussion thread you linked to will come in handy.

Leave a Reply

Note: You can use basic XHTML in your comments. Your email address will never be published.

Subscribe to this comment feed via RSS