On Mon, Jun 10, 2013 at 10:50 PM, MHCPU <[email protected]> wrote:

> Thanks Alessandro.  I had actually started out with FriendlyForm and
> thought incorrectly that FastForm might be the solution.  Here's the real
> problem...
>
> In the default post_login handler in root.py, the check for whether
> authentication worked is:
>
>         if not request.identity:
>              redirect('/login'...
>
> but although the LDAP authentication appears to succeed,
> "request.identity" is still None, and the user is redirected back to the
> login form.  What's the right thing to test if the user successfully
> authenticated?
>

Check in your project lib/base.py that is the place where request.identity
is set.
Generally repoze.who will set a bunch of repoze.who.* keys inside the
environ dictionary to report the successfully authentication, look for
those to see what's happening.
If you are successfully authenticated, but you don't have an user it is
usually due to issues with the metadata provider.


> Note that there is a version clash between TG2.3 beta and the repoze LDAP
> plugin, which wants repoze.who >= 1.0.6, < 2.0dev (I changed its
> requires.txt to "repoze.who >= 1.0.6", ignoring the consequences). Also,
> FriendlyForm requires installing Paste, which I believe has mostly been
> replaced.  I'm not sure if either of these is contributing to my problem.
>

There are some API differences between repoze.who 1.X and repoze.who 2.X,
if you need to use repoze.who 1.X you might want to check that your whole
auth framework is setup using the repoze.who+repoze.what stack, otherwise
you might be mixing incompatible pieces. Usually things work anyway as the
api are similar enough, but there might be cases where something goes wrong.

-- 
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/turbogears?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to