On Wed, Sep 26, 2012 at 04:56:58AM -0700, Tom Christie wrote:
> I take it you mean two authentication methods that always need to *both*
> run, rather than two authentication methods, either of which might succeed?
Yes, exactly. And they authenticate different entities (applications and users of these applications).
> Right now that'd be a little awkward. You could override the logic in
> AuthMixin, but it'd probably be easiest to just shoehorn the logic into a
> single authentication class and set additional properties on the user
> instance before returning it if you need to add extra metadata.
>
> Cue the familiar line "this'll be better in 2.0", both because:
>
> * It'a more simple to override the authentication behavior to allow
> multiple authentication policies to succeed.
> * Authentication classes return both a `user` and an `auth` object, which
> makes it easier to return custom authentication data.
>
> Help any?
Thanks, I'll try this in code.
Also I think it can be easier to just check application token in middleware.