I am looking for a clean way of implementing two or more different
authentication policies inside a pyramid application, and select the
policy a per view basis, maybe with an overload of the view_config
decorator.
From the little I understand, there is only one authentication policy
in the "registry", so it looks like the best way to go would be to :
- create an authentication policy "implementing" the
IAuthenticationPolicy interface
- "mark" view functions
- find the way from the request passed to the authentication
policy methods to the corresponding view
- inside the authentication policy, call authentication methods
based on the view "mark"
- set the new authentication policy as usual with
config.set_authentication_policy
Do you think this is possible ? Is there a better way ?
Regards,
David.
Seems possible. You might also check out;
http://pypi.python.org/pypi/pyramid_multiauth/0.1.2
>
> Regards,
>
> David.
>