Re: [Repoze-dev] Different auth method on different pages, possible ?

2011-09-23 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 09/23/2011 06:48 AM, Roland Hedberg wrote:

> I wonder how, if possible, one would configure repoze.who to use 
> different auth method for different pages ?
> 
> More specifically I'd like to use basic auth for one page and form 
> login for another.

The 'request_classifier' component is responsible for sniffing the
environ and returning a string label for the "request type"[1].  You can
define a custom classifier, and then associate plugins only with
requests having the appropriate label[2].

[1] See how the 'default_request_classifier' does this:

https://github.com/repoze/repoze.who/blob/master/repoze/who/classifiers.py

[2] The example configuration does this for the 'redirector' plugin
(the one which sends the user to the login form):

http://docs.repoze.org/who/2.0/configuration.html#configuring-repoze-who-via-config-file


Tres.
- -- 
===
Tres Seaver  +1 540-429-0999  tsea...@palladion.com
Palladion Software   "Excellence by Design"http://palladion.com
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk585Z0ACgkQ+gerLs4ltQ7TuACdHlxQQIGxVKBa2JHXHrr9AcwI
8IEAoMsS1FAnGni2myzJrwLqqcII+C7m
=0Ude
-END PGP SIGNATURE-
___
Repoze-dev mailing list
Repoze-dev@lists.repoze.org
http://lists.repoze.org/listinfo/repoze-dev


[Repoze-dev] Different auth method on different pages, possible ?

2011-09-23 Thread Roland Hedberg
Hi!

I wonder how, if possible, one would configure repoze.who to use different auth 
method for different pages ?

More specifically I'd like to use basic auth for one page and form login for 
another.

-- Roland
___
Repoze-dev mailing list
Repoze-dev@lists.repoze.org
http://lists.repoze.org/listinfo/repoze-dev