Re: [web2py] Re: Authenticating with Facebook using OAuth 2.0

2012-03-17 Thread Michele Comitini
Hassan,

Ok.  As Alan points out check for the port in the URL.
Try to see if facebook authentication server is redirecting to your
application correctly.  You can check using firebug or chrome
developer tools.
Sometimes changing options in the facebook application control panel
is not enough, if that is the case you have to delete and recreate the
facebook application.

mic

Il 17 marzo 2012 11:35, Hassan Alnatour  ha scritto:
> Michele,
>
> I have No Code in the Controller or in the View , i followed the book
> instructions ..
>
>
> Alan ,
>
> The domain that i used for my website is a sub domain and when i
> created an application in facebook i gave it the same domain .. and
> its just the code that i showed you above i followed the instructions
> in the book


[web2py] Re: Authenticating with Facebook using OAuth 2.0

2012-03-17 Thread Alan Etkin
Hassan, I clicked more than the necessary in my browser, and marked
one of your messages as spam (unintentionally, of course)

On 17 mar, 13:22, Alan Etkin  wrote:
> https://www.test.i3zif.com:443
> orhttp://www.test.i3zif.com:80
>
> On 17 mar, 09:48, Hassan Alnatour  wrote:
>
>
>
>
>
>
>
> > so you want me to make the application domain in facebook like 
> > thishttp://www.test.i3zif.com:443??


[web2py] Re: Authenticating with Facebook using OAuth 2.0

2012-03-17 Thread Alan Etkin
https://www.test.i3zif.com:443
or
http://www.test.i3zif.com:80

On 17 mar, 09:48, Hassan Alnatour  wrote:
> so you want me to make the application domain in facebook like 
> thishttp://www.test.i3zif.com:443??


[web2py] Re: Authenticating with Facebook using OAuth 2.0

2012-03-17 Thread Alan Etkin
I meant the other parameter (site URL or something of the like)

On 17 mar, 09:48, Hassan Alnatour  wrote:
> so you want me to make the application domain in facebook like 
> thishttp://www.test.i3zif.com:443??


[web2py] Re: Authenticating with Facebook using OAuth 2.0

2012-03-17 Thread Hassan Alnatour
so you want me to make the application domain in facebook like this
http://www.test.i3zif.com:443 ??


[web2py] Re: Authenticating with Facebook using OAuth 2.0

2012-03-17 Thread Alan Etkin
I know this is odd, but I'd try using the this url in the facebook
application site url parameter:

http://www.test.i3zif.com:80/

As the book example asks to specify the tcp port of the address. If
you need to use https, then replace 80 with 443

On 17 mar, 07:35, Hassan Alnatour  wrote:
> Michele,
>
> I have No Code in the Controller or in the View , i followed the book
> instructions ..
>
> Alan ,
>
> The domain that i used for my website is a sub domain and when i
> created an application in facebook i gave it the same domain .. and
> its just the code that i showed you above i followed the instructions
> in the book


[web2py] Re: Authenticating with Facebook using OAuth 2.0

2012-03-17 Thread Hassan Alnatour
Michele,

I have No Code in the Controller or in the View , i followed the book
instructions ..


Alan ,

The domain that i used for my website is a sub domain and when i
created an application in facebook i gave it the same domain .. and
its just the code that i showed you above i followed the instructions
in the book


[web2py] Re: Authenticating with Facebook using OAuth 2.0

2012-03-16 Thread Alan Etkin
I have installed the app from the book support files and it works
(with a dyndns subdomain and rocket dev. server). Could you post your
facebook application configuration? (not the id or client
credentials). Have you tried specifying the tcp port in the facebook
configuration for the site url?

On 16 mar, 13:31, Hassan Alnatour  wrote:
> Dear ALL ,
>
> I Got the new cookbook and i am having some problems , its now
> working , here is what i did :
>
> 1 - i created an application on facebook and added a Site Domain >
> test.i3zif.com  and Site URL >http://www.test.i3zif.com/
> hellofacebook .
>
> 2 - i created and file named it fbappauth.py and added my app id and
> the secret id  in the modules Folder .
>
> 3- i downloaded the python SDK from github and included the file
> FaceBook.py in  my modules.
>
> 4 - added this code in bottom of  db.py file :
>
> #
> ## use fb auth
> ## for facebook "graphbook" application
> #
> import sys, os
> from fbappauth import CLIENT_ID,CLIENT_SECRET
> from facebook import GraphAPI, GraphAPIError
> from gluon.contrib.login_methods.oauth20_account import OAuthAccount
>
> class FaceBookAccount(OAuthAccount):
>     """OAuth impl for FaceBook"""
>     AUTH_URL="https://graph.facebook.com/oauth/authorize";
>     TOKEN_URL="https://graph.facebook.com/oauth/access_token";
>     def __init__(self, g):
>         OAuthAccount.__init__(self, g, CLIENT_ID, CLIENT_SECRET,
>         self.AUTH_URL, self.TOKEN_URL,
>         scope='user_photos,friends_photos')
>         self.graph = None
>     def get_user(self):
>         '''Returns the user using the Graph API.'''
>         if not self.accessToken():
>             return None
>         if not self.graph:
>             self.graph = GraphAPI((self.accessToken()))
>             user = None
>         try:
>             user = self.graph.get_object("me")
>
>         except GraphAPIError, e:
>             self.session.token = None
>             self.graph = None
>         if user:
>             return dict(first_name = user['first_name'],last_name =
> user['last_name'],username = user['id'])
>
> auth.settings.actions_disabled =
> ['register','change_password','request_reset_password','profile']
> auth.settings.login_form=FaceBookAccount(globals())
> auth.settings.login_next=URL(f='index')
>
> 4 - uploaded the application to my server , then i opened 
> "http://www.test.i3zif.com/hellofacebook.";  and there was nothing and then i
> pressed login and  it gave me this massage :
>
>                invalid function (default/oauth)
>
> What is wrong guys  ..  hope someone can help me ..
>
> Best Regards ,
> Hassan Alnatour