If I remove: if request.args(0) == 'facebook': from the controller method, I can get authenticated by facebook and get redirected to the auth.settings.login_next URL.
It seems that this is an all-or-nothing login mechanism. One application can only support one type of authentication method. Is this correct? On Oct 11, 8:49 pm, firedragon852 <[email protected]> wrote: > Hi, I have the following code: > > def login(): > ... > if request.args(0) == 'facebook': > from gluon.contrib.login_methods.oauth20_account import > OAuthAccount > auth.settings.login_form = FacebookAccount(globals()) > return dict(form=auth.login()) > > When I go to the url .../login/facebook, I get directed to facebook's > login page. I can login successfully, but instead of going to > auth.settings.login_next, I get redirected to ../login. I think it is > because auth.settings.login_next is a URL that has > @auth.requires_login(). > > I want to be able to support both auth and facebook logins, and with > only ../login, auth.settings.login_form is not set and login will use > auth. Are there any problems with this approach? > > I am using web2py version 1.86.2.

