I've been trying to use OAuth2.0 and the facebook module to allow a user to 
login to my site, and then use the facebook API to obtain info about them 
via GraphAPI.

The web2py manual (8.1.6, subsection "OAuth2.0 and facebook") describes two 
methods, the first to "login to your own app", the second to "a specific 
[user's] Facebook to access its API". 

I think the second one is what I want. I followed the example:

from facebook import GraphAPI 

... 

class FacebookAccount(OAuthAccount):

...

auth.settings.login_form =  FacebookAccount(globals())


But when I try it out, I get the error message from facebook:

{
   "error": {
      "type": "OAuthException",
      "message": "Invalid redirect_uri: Given URL is not allowed by the 
Application configuration."
   } 

} 


I noticed that the redirect URL that is shown in the browser seems not to be 
that of the website running my web2py app (it has it's own domain name), but 
rather the IP address of my local connection at home (emphasized with bold 
and large font in the URL string below):

https://graph.facebook.com/oauth/authorize?redirect_uri=http%3A%2F%2F*
69.234.184.92*
%2Fsandbox_luis%2Fdefault%2Fuser%2Flogin%3F_next%3D%252Fsandbox_luis%252Fdefault%252Findex&response_type=code&client_id=219317251425055

 
What have I done wrong, or what else do I need to do?  
(I have registered the app on facebook, and defined the site URL and site 
domain there.)

Thanks,
Luis.

Reply via email to