Re: [Repoze-dev] Question regarding repoze.who +sql / repoze.who.plugins.sa
Hello, Mathieu. On Thursday January 15, 2009 21:18:00 Mathieu Drapeau wrote: I do not get redirected to the restricted page (ex. test.html), I do get redirected to the same form again (ex. loginform.html) after entering a valid user/pass. I do look if I am authenticated after I filled the form and I do. Based on the logs, the authentication process seems to be called twice and it is why the came_from is changed from test.html to loginform.html. OK, I see, but we can't help if you don't show us the way you're configuring the plugin, as I asked in the previous email ;-) By the way, so time ago somebody using TG2 was getting that behavior because the login form was not using login for the user name field and password for the password field. Can you please make sure that's not the problem? If not, then also post the code for your login form. Cheers. -- Gustavo Narea http://gustavonarea.net/. Get rid of unethical constraints! Get freedomware: http://www.getgnulinux.org/ ___ Repoze-dev mailing list Repoze-dev@lists.repoze.org http://lists.repoze.org/listinfo/repoze-dev
Re: [Repoze-dev] Question regarding repoze.who +sql / repoze.who.plugins.sa
Hi Gustavo, The input fields are like that: input type=text name=login/input input type=password name=password/input And here is my config file: http://pastebin.com/f55810cb3 Thanks, Mathieu 2009/1/16 Gustavo Narea m...@gustavonarea.net Hello, Mathieu. On Thursday January 15, 2009 21:18:00 Mathieu Drapeau wrote: I do not get redirected to the restricted page (ex. test.html), I do get redirected to the same form again (ex. loginform.html) after entering a valid user/pass. I do look if I am authenticated after I filled the form and I do. Based on the logs, the authentication process seems to be called twice and it is why the came_from is changed from test.html to loginform.html. OK, I see, but we can't help if you don't show us the way you're configuring the plugin, as I asked in the previous email ;-) By the way, so time ago somebody using TG2 was getting that behavior because the login form was not using login for the user name field and password for the password field. Can you please make sure that's not the problem? If not, then also post the code for your login form. Cheers. -- Gustavo Narea http://gustavonarea.net/. Get rid of unethical constraints! Get freedomware: http://www.getgnulinux.org/ ___ Repoze-dev mailing list Repoze-dev@lists.repoze.org http://lists.repoze.org/listinfo/repoze-dev
Re: [Repoze-dev] Question regarding repoze.who +sql / repoze.who.plugins.sa
Hello, Mathieu. Did you already set the came_from parameter passed to the login handler as I mentioned on IRC? I am sure that's the problem. If it doesn't solve the problem, then please post the code of the form *and* the code of the action that handles the display of the form. Cheers. On Friday January 16, 2009 19:04:22 Mathieu Drapeau wrote: Hi Gustavo, The input fields are like that: input type=text name=login/input input type=password name=password/input And here is my config file: http://pastebin.com/f55810cb3 -- Gustavo Narea http://gustavonarea.net/. Get rid of unethical constraints! Get freedomware: http://www.getgnulinux.org/ ___ Repoze-dev mailing list Repoze-dev@lists.repoze.org http://lists.repoze.org/listinfo/repoze-dev
Re: [Repoze-dev] Question regarding repoze.who +sql / repoze.who.plugins.sa
Hello, Mathieu. On Wednesday January 14, 2009 00:03:52 you wrote: I had to change the username field in the database to: user_name even if the parameter user_name_translation was set to something else but this is minor. Can you please paste the translation line? The key is user_name, not user_name_translation, by the way. Now, the issue I have is that when I am logging in or out, the url is not redirected to the referer but to the actual login form. When I am looking at the log, the plugin forms was asked twice to be identified. I can understand that the referer is set the the form after the second passage but is it normal? I didn't understand this very well. The normal behavior is: - when you visit a restricted area in your website, you'll get the login form and after you login, you'll get redirected to the restricted page above. - if you visit the login page voluntarily, then you'll get redirected to the home page after login. - if you visit the logout page, you'll get redirected to the previous page. Is this the behavior you've noticed? Do you think maybe my who.ini was not properly set up? Here is the last part: [identifiers] plugins = redirform auth_tkt [authenticators] plugins = sa_auth [challengers] plugins = redirform That seems right, but it may also be useful to know how you're defining redirform. Cheers! - Gustavo. Thank you, Mathieu 2009/1/13 Gustavo Narea m...@gustavonarea.net Hello, Mathieu et al. On Thursday January 8, 2009 00:12:28 you wrote: I would like to ask you a simple question, feel free to let me know if you don't have time. I decided to just stick with a basic db authentication, and I am using an external who.ini conf file. The problem is the it seems that repoze tries to open its own session with the database. I would prefer using the one that is already defined inside pylons to avoid redundancies and many db connections. Do you have a clue how it could be done? I guess I wouldn't be able to use the setup file but instead the middleware configuration (even that way, I am not sure how to do it). Hmmm, repoze.who.plugins.sa doesn't start a new session, instead it always uses the one you specified. In your case, if you have the following line in your who.ini file: dbsession = youapp.whatever:DBSession repoze.who.plugins.sa will use youapp.whatever.DBSession as the SQLAlchemy session, the way you will find here (see SQLAlchemyAuthenticatorPlugin): http://repoze.org/viewcvs/whoplugins/whoalchemy/trunk/repoze/who/plugins/ sa.py?rev=3125view=markup Cheers! -- Gustavo Narea http://gustavonarea.net/. Get rid of unethical constraints! Get freedomware: http://www.getgnulinux.org/ -- Gustavo Narea http://gustavonarea.net/. Get rid of unethical constraints! Get freedomware: http://www.getgnulinux.org/ ___ Repoze-dev mailing list Repoze-dev@lists.repoze.org http://lists.repoze.org/listinfo/repoze-dev
Re: [Repoze-dev] Question regarding repoze.who +sql / repoze.who.plugins.sa
I didn't understand this very well. The normal behavior is: - when you visit a restricted area in your website, you'll get the login form and after you login, you'll get redirected to the restricted page above. - if you visit the login page voluntarily, then you'll get redirected to the home page after login. - if you visit the logout page, you'll get redirected to the previous page. Is this the behavior you've noticed? Hi Gustavo, I do not get redirected to the restricted page (ex. test.html), I do get redirected to the same form again (ex. loginform.html) after entering a valid user/pass. I do look if I am authenticated after I filled the form and I do. Based on the logs, the authentication process seems to be called twice and it is why the came_from is changed from test.html to loginform.html. Hope it is clear. Thank you, Mathieu ___ Repoze-dev mailing list Repoze-dev@lists.repoze.org http://lists.repoze.org/listinfo/repoze-dev
Re: [Repoze-dev] Question regarding repoze.who +sql / repoze.who.plugins.sa
Hello, Mathieu et al. On Thursday January 8, 2009 00:12:28 you wrote: I would like to ask you a simple question, feel free to let me know if you don't have time. I decided to just stick with a basic db authentication, and I am using an external who.ini conf file. The problem is the it seems that repoze tries to open its own session with the database. I would prefer using the one that is already defined inside pylons to avoid redundancies and many db connections. Do you have a clue how it could be done? I guess I wouldn't be able to use the setup file but instead the middleware configuration (even that way, I am not sure how to do it). Hmmm, repoze.who.plugins.sa doesn't start a new session, instead it always uses the one you specified. In your case, if you have the following line in your who.ini file: dbsession = youapp.whatever:DBSession repoze.who.plugins.sa will use youapp.whatever.DBSession as the SQLAlchemy session, the way you will find here (see SQLAlchemyAuthenticatorPlugin): http://repoze.org/viewcvs/whoplugins/whoalchemy/trunk/repoze/who/plugins/sa.py?rev=3125view=markup Cheers! -- Gustavo Narea http://gustavonarea.net/. Get rid of unethical constraints! Get freedomware: http://www.getgnulinux.org/ ___ Repoze-dev mailing list Repoze-dev@lists.repoze.org http://lists.repoze.org/listinfo/repoze-dev