Any help is much appreciated, I've been trying to figure this out all day
jc <j-clark@...> writes:

> 
> 
> I am trying to get janrain login to work in test mode on my development
machine. The problem I have is that when I try to execute a controller function
for which I have set  <at> auth.requires_login(), the system correctly routes me
to "http://localhost:8000/list/default/user/login?_next=/list/default/func"; and
displays login buttons. I click on a login button (google, yahoo etc) and a
window opens for me to sign in. I sign in, and now the system routes me to url
"http://localhost:8000/list/default/user/login?token=bbed656a8bdef20ebc23fecf14d328b90ea6c481";,
and the login buttons are still displayed. I can now try to login as often as I
like, but I get no further. No entries have been created in the auth tables.
> 
> 
> I am using web2py 1.99.4 on linux. I am following the instructions
in http://web2py.com/books/default/chapter/29/9#Integration-with-OpenID,-Facebook,-etc.
> 
> The steps I have taken are:
> 
> - register for janrain
> - in janrain settings enter localhost on the domain whitelist
> - create janrain.key file containing 'localhost:xxxxxxxx...xxxx' where xxxx
etc is the API Key (Secret) supplied by janrain
> - in web2py in a standard welcome app, or a wizard created app, or a 'New
simple application':
> -- put the janrain.key file into .../web2py/applications/app/private
> -- the standard welcome app includes (in db.py)
> from gluon.contrib.login_methods.rpx_account import use_janrain
> use_janrain(auth,filename='private/janrain.key')
>    which, because of the code in gluon.contrib.login_methods.rpx_account
automatically does the "auth.settings.actions_disabled = ...." 
>    and  auth.settings.login_form =
RPXAccount(request, api_key='...',  domain='...',  url =
"http://localhost:8000/%s/default/user/login"; %request.application)
>    stuff for me, once the janrain.key file exists.
> -- add  <at> auth.requires_login() just before a function, to force the
sign-in requirement. Usually I just do it to the index() function of the
standard default welcome app, for testing.
> -- In the controller I have the standard user function i.e. def user(): return
dict(form=auth()) and the associated view exists.
> 
> I can't see anything else I am supposed to do from chapter 8 of the book. I
fondly imagined that the auth() call in user() would handle getting whatever
data is sent from janrain, create entries in the auth tables etc.
> 
> Thanks for any assistance.
> 

Glad it's working! I've been having the same exact problem you described, but
this fix didn't work for me. What are you using as your token URL? 
This concept is foggy to me. It's not mentioned in the web2py book, but is
described on the janrain site
https://rpxnow.com/relying_parties/resource-pool/setup_tokenurl#steps



Reply via email to