Re: [web2py] How to access facebook graph of logged in user

2012-05-15 Thread Michele Comitini
That problem is simply due to the fact that in facebook the
application has been registered with a domain name and a base url that
differ from the one where your web2py application is published.
Sometimes even changing the domain name in facebook form does not
correct the problem.  In that case you can try to delete and recreate
the application on facebook.

mic

2012/5/15 www.diazluis.com :
> greetings
> I have the same problem
> could you explain me the configuration that mensionas with an example?
> note:
> my hosting is WebFaction
> my domains are registered in Dattatec
>
>
> El lunes, 13 de junio de 2011 17:37:06 UTC-4:30, sebastian escribió:
>>
>> I had similar problems... fixed using dns names rather that IP numbers...
>>
>> On Mon, Jun 13, 2011 at 7:08 PM, wrote:
>>
>>> Hi Michele!
>>>
>>> I get the same error as before:
>>>
>>> {
>>>"error": {
>>>   "type": "OAuthException",
>>>   "message": "Invalid redirect_uri: Given URL is not allowed by the
>>> Application configuration."
>>>}
>>> }
>>>
>>> from the following URL:
>>>
>>>
>>> https://graph.facebook.com/oauth/authorize?scope=user_photos%2Cfriends_photos&redirect_uri=http%3A%2F%2F69.234.184.92%2FhelloFacebook%2F
>>>
>>>
>>> default%2Fuser%2Flogin%3F_next%3D%252FhelloFacebook%252Fdefault%252Findex&response_type=code&
>>>
>>>  client_id=219317251425055
>>>
>>>
>>> Again, the redirect_uri has my home IP address instead of the web2py
>>> server's domain name or IP (I don't know if that's a problem or not).
>>>
>>> I made a modules/fbappauth.py  with my CLIENT_ID and CLIENT_SECRET
>>>
>>> for some reason,  in models/db.py,
>>>
>>> from facebook import GraphAPI, GraphAPIError
>>>
>>>
>>> did not work, so I had to use
>>>
>>> import facebook
>>>
>>> ...
>>>
>>> ..., facebook.GraphAPI, ...
>>>
>>>
>>>
>>>
>>> At facebook, I have defined
>>>
>>> Site URL :   http://mydomain.com/
>>>
>>>
>>> Site domain: mydomain.com
>>>
>>>
>>> (where  'mydomain'  is my actual domain name)
>>>
>>>
>>> The domain is running on an Amazon ec2 server,  with the web2py framework
>>> (version 1.95.1).
>>>
>>>
>>>
>>>  Does any of this look wrong?    How did you do your setup at facebook?
>>>
>>> Thanks,
>>> Luis.
>>>
>>>
>>
>>
>>
>>
>> --
>> Sebastian E. Ovide
>>
>>
>>
>


Re: [web2py] How to access facebook graph of logged in user

2012-05-14 Thread www.diazluis.com
greetings
I have the same problem
could you explain me the configuration that mensionas with an example?
note:
my hosting is WebFaction
my domains are registered in Dattatec


El lunes, 13 de junio de 2011 17:37:06 UTC-4:30, sebastian escribió:
>
> I had similar problems... fixed using dns names rather that IP numbers...
>
> On Mon, Jun 13, 2011 at 7:08 PM, wrote:
>
>> Hi Michele!
>>
>> I get the same error as before:
>>
>> {
>>"error": {
>>   "type": "OAuthException",
>>   "message": "Invalid redirect_uri: Given URL is not allowed by the 
>> Application configuration."
>>}
>> }
>>
>> from the following URL:
>>
>>
>> https://graph.facebook.com/oauth/authorize?scope=user_photos%2Cfriends_photos&redirect_uri=http%3A%2F%2F69.234.184.92%2FhelloFacebook%2F
>>  
>>
>>
>> default%2Fuser%2Flogin%3F_next%3D%252FhelloFacebook%252Fdefault%252Findex&response_type=code&
>>
>>  client_id=219317251425055
>>
>>
>> Again, the redirect_uri has my home IP address instead of the web2py 
>> server's domain name or IP (I don't know if that's a problem or not).
>>
>> I made a modules/fbappauth.py  with my CLIENT_ID and CLIENT_SECRET
>>
>> for some reason,  in models/db.py,
>>
>> from facebook import GraphAPI, GraphAPIError
>>
>>  
>> did not work, so I had to use
>>
>> import facebook
>>
>> ...
>>
>> ..., facebook.GraphAPI, ... 
>>
>>  
>>
>>
>> At facebook, I have defined
>>
>> Site URL :   http://mydomain.com/
>>
>>
>> Site domain: mydomain.com
>>
>>
>> (where  'mydomain'  is my actual domain name) 
>>
>>
>> The domain is running on an Amazon ec2 server,  with the web2py framework 
>> (version 1.95.1). 
>>
>>  
>>
>>  Does any of this look wrong?How did you do your setup at facebook?
>>
>> Thanks,
>> Luis.
>>
>>  
>>
>>
>
>
> -- 
> Sebastian E. Ovide
>
>
>
>

Re: [web2py] How to access facebook graph of logged in user

2011-06-13 Thread Sebastian E. Ovide
I had similar problems... fixed using dns names rather that IP numbers...

On Mon, Jun 13, 2011 at 7:08 PM,  wrote:

> Hi Michele!
>
> I get the same error as before:
>
> {
>"error": {
>   "type": "OAuthException",
>   "message": "Invalid redirect_uri: Given URL is not allowed by the 
> Application configuration."
>}
> }
>
> from the following URL:
>
>
> https://graph.facebook.com/oauth/authorize?scope=user_photos%2Cfriends_photos&redirect_uri=http%3A%2F%2F69.234.184.92%2FhelloFacebook%2F
>
>
>
> default%2Fuser%2Flogin%3F_next%3D%252FhelloFacebook%252Fdefault%252Findex&response_type=code&
>
>  client_id=219317251425055
>
>
> Again, the redirect_uri has my home IP address instead of the web2py
> server's domain name or IP (I don't know if that's a problem or not).
>
> I made a modules/fbappauth.py  with my CLIENT_ID and CLIENT_SECRET
>
> for some reason,  in models/db.py,
>
> from facebook import GraphAPI, GraphAPIError
>
>
> did not work, so I had to use
>
> import facebook
>
> ...
>
> ..., facebook.GraphAPI, ...
>
>
>
>
> At facebook, I have defined
>
> Site URL :   http://mydomain.com/
>
>
> Site domain: mydomain.com
>
>
> (where  'mydomain'  is my actual domain name)
>
>
> The domain is running on an Amazon ec2 server,  with the web2py framework
> (version 1.95.1).
>
>
>
>  Does any of this look wrong?How did you do your setup at facebook?
>
> Thanks,
> Luis.
>
>
>
>


-- 
Sebastian E. Ovide


Re: [web2py] How to access facebook graph of logged in user

2011-06-13 Thread lgoncalves
Hi Michele!

I get the same error as before:

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

from the following URL:

https://graph.facebook.com/oauth/authorize?scope=user_photos%2Cfriends_photos&redirect_uri=http%3A%2F%2F69.234.184.92%2FhelloFacebook%2F
 

default%2Fuser%2Flogin%3F_next%3D%252FhelloFacebook%252Fdefault%252Findex&response_type=code&

 client_id=219317251425055


Again, the redirect_uri has my home IP address instead of the web2py 
server's domain name or IP (I don't know if that's a problem or not).

I made a modules/fbappauth.py  with my CLIENT_ID and CLIENT_SECRET

for some reason,  in models/db.py,

from facebook import GraphAPI, GraphAPIError

 
did not work, so I had to use

import facebook

...

..., facebook.GraphAPI, ... 

 


At facebook, I have defined

Site URL :   http://mydomain.com/


Site domain: mydomain.com


(where  'mydomain'  is my actual domain name) 


The domain is running on an Amazon ec2 server,  with the web2py framework 
(version 1.95.1). 

 

 Does any of this look wrong?How did you do your setup at facebook?

Thanks,
Luis.

 



Re: [web2py] How to access facebook graph of logged in user

2011-06-12 Thread Michele Comitini
Hi Luis,

Copy the code from here:
http://code.google.com/r/michelecomitini-facebookaccess/source/browse/#hg%2Fapplications%2FhelloFacebook

and let me know if it works

mic

2011/6/12 Luis Goncalves :
> 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%2F69.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.


[web2py] How to access facebook graph of logged in user

2011-06-11 Thread Luis Goncalves
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.