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 to “Pylons AuthKit forward and RecursiveMiddleware’s ForwardRequestException”

  1. thank you!

  2. 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

 Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">

   
© 2012 rootsmith blog Suffusion theme by Sayontan Sinha