Hello,
On Sunday January 18, 2009 10:51:03 drakkan wrote:
> I would like to use http auth with turbogears2 instead of the default
> auth, so I would like to use only http auth
>
> I looked at:
>
> http://www.turbogears.org/2.0/docs/main/Auth/Customization.html
>
> but I'm yet not able to use http auth.
>
> Can someone give some more detailed directions?
>
> for example
>
> "ou may use something like this in {yourproject}.config" config is a
> directory maybe the documentation mean {yourproject}.config.app_cfg?
I'm sorry, that part of the documentation is wrong, but I fixed it in trunk
some days ago so it'll get updated soon.
> when I set:
>
> "app_cfg.sa_auth.authenticators = [('http_auth', http_auth)]"
>
> I have the error:
>
> ValueError: http_auth: An object has failed to implement interface
> <InterfaceClass repoze.who.interfaces.IAuthenticator>
>
> The authenticate attribute was not provided.
Right, that's because BasicAuthPlugin is a repoze.who identifier and
challenger, not an authenticator (that's the mistake I've fixed). Try this
instead:
app_cfg.sa_auth.form_plugin = http_auth
That will replace the default login form with HTTP authentication. But if you
just want to add HTTP authentication as a *secondary* authentication method,
then use this line:
app_cfg.sa_auth.identifiers = [('http_auth', http_auth)]
app_cfg.sa_auth.challengers = [('http_auth', http_auth)]
HTH.
--
Gustavo Narea.
General Secretary.
GNU/Linux Matters <http://gnulinuxmatters.org/>.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears" 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/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---