Hi All,
just wondering if the section "OAuth2.0 and Facebook" of the book is up to
date?
I following it's instructions but I'm getting an "Internal error"
to reproduce
1) get last web2py 1.196.3
2) follow the instructions from the book
2.a) get facebook and place it in modules
2.b) copy the code from the book
2.c) replace "from facebook import GraphAPI" with "facebook =
local_import('facebook')"
2.d) replace facebook. to GraphAPIError and GraphAPI
2.e) replace YOUR_CLIENT_ID and YOUR_CLIENT_SECRET with real data
3) set your app URL to http://localhost:8000/welcome/
Is something missing ?
When I click login, it redirect me to facebook, where I can login, and then
it redirects me to http://localhost:8000/welcome/
At that point I get an error:
TRACEBACK
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
Traceback (most recent call last):
File "/home/sebas/Downloads/web2py/gluon/restricted.py", line 184,
in restricted
exec ccode in environment
File
"/home/sebas/Downloads/web2py/applications/welcome/controllers/default.py"
<http://localhost:8000/admin/default/edit/welcome/controllers/default.py>,
line 71, in <module>
File "/home/sebas/Downloads/web2py/gluon/globals.py", line 137, in <lambda>
/ self._caller = lambda f: f()
File
"/home/sebas/Downloads/web2py/applications/welcome/controllers/default.py"
<http://localhost:8000/admin/default/edit/welcome/controllers/default.py>,
line 33, in user
return dict(form=auth())
File "/home/sebas/Downloads/web2py/gluon/tools.py", line 1070, in __call__
return getattr(self,args[0])()
File "/home/sebas/Downloads/web2py/gluon/tools.py", line 1626, in login
user = self.get_or_create_user(table_user._filter_fields(cas_user))
File "/home/sebas/Downloads/web2py/gluon/tools.py", line 1360, in
get_or_create_user
user = self.db(table_user[username] == keys[username]).select().first()
KeyError: 'email'
any ideas , thanks
--
Sebastian E. Ovide