On Feb 14, 1:37 pm, Armin Ronacher <[EMAIL PROTECTED]>
wrote:
> Hi,
>
> On Feb 14, 12:09 pm, Rob Cowie <[EMAIL PROTECTED]> wrote:> I'd like to add
> basic HTTP auth to a simple prototype app I'm
> > creating. I had assumed that raising the HTTPException Unauthorized
> > would cause the client to reissue the request after auth prompt. It
> > isn't.
>
> HTTP Basic Auth is simple to implement but you might want to consider
> using Authkit or something like that. The basic concept of HTTP basic
> auth looks like this:http://paste.pocoo.org/show/27676/
>
Thanks, very useful.
The missing component was the WWW-Authenticate header in my response.
I've subclassed the Unauthorized http exception, added this header and
now can simply raise MyUnauthException(realm='myrealm'), return it as
a response and all is well in my - admittedly simple - app.
Next step... authkit I think.
cheers
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"pocoo-libs" 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/pocoo-libs?hl=en
-~----------~----~----~----~------~----~------~--~---