Authkit - deferring action to HTTP response to client application

Posted by jon on Stack Overflow See other posts from Stack Overflow or by jon
Published on 2010-04-08T18:18:41Z Indexed on 2010/04/08 18:23 UTC
Read the original article Hit count: 265

Filed under:

Form, Redirect and Forward all send an unauthenticated user to a Form on a login page specified within an Authkit middleware application. I'd like to allow a client application to request a service via XHR and then present a custom 'client side' form if a HTTP status code of 401 is returned, which would then post to Authkit for authentication until valid authentication/authorization occured.

Specifically, 1) a jquery $.get request might request a resource. 2) if an Authkit cookie check confirmed previous authorization the content would be returned. 3) if not I would like Authkit to simply return the '401 response' (and not redirect to another page, or return a form template) where a client side exception handler would notify the user and present an authentication form. Can Authkit work like this?

© Stack Overflow or respective owner

Related posts about authkit