Thanks for the link, but I am not able to get it to work. Maybe I'm doing 
some thing wrong. Would you please verify this:
I create the private/dropbox.key file with APP_KEY:APP_SECRET:dropbox
in models/db.py I have added:
    from gluon.contrib.login_methods.dropbox_account import use_dropbox
    use_dropbox(auth,filename='private/dropbox.key')

In the default controller, I have this in the index():

def index():
client = auth.settings.login_form.client
return dict(message=T("Welcome " + client.account_info()['display_name'])) 

When the user is authenticated and redirected to /default/index I get the 
following error:

<type 'exceptions.AttributeError'> 'DropboxAccount' object has no attribute 
'client' Version  web2py™ Version 2.4.5-stable+timestamp.2013.03.18.22.46.22  
Python Python 2.7.3: C:\Python27\python.exe (prefix: C:\Python27)  Traceback 

1.
2.
3.
4.
5.
6.
7.
8.
9.
10.

Traceback (most recent call last):
  File "C:\Users\Administrator\Documents\web2py\gluon\restricted.py", line 212, 
in restricted
    exec ccode in environment
  File 
"C:/Users/Administrator/Documents/web2py/applications/dropbox/controllers/default.py"
 <http://localhost:8000/admin/default/edit/dropbox/controllers/default.py>, 
line 73, in <module>
  File "C:\Users\Administrator\Documents\web2py\gluon\globals.py", line 194, in 
<lambda>
    self._caller = lambda f: f()
  File 
"C:/Users/Administrator/Documents/web2py/applications/dropbox/controllers/default.py"
 <http://localhost:8000/admin/default/edit/dropbox/controllers/default.py>, 
line 13, in index
    client = auth.settings.login_form.client
AttributeError: 'DropboxAccount' object has no attribute 'client'



On Tuesday, April 2, 2013 2:54:19 PM UTC-7, Massimo Di Pierro wrote:
>
> Why are you reinventing the wheel?
>
> look into gluon/contrib/login_methods/dropbox_account.py
>
> On Tuesday, 2 April 2013 14:40:10 UTC-5, Yassine Elouri wrote:
>>
>> I am using web2py v2.4.5 and dropbox v1.5.1 for a project and I get 
>> "invalid token" error. I have a default controller with 3 methods. index() 
>> takes the user to the authorization url with a callback to welcome(). This 
>> part works fine. When I make a call to the third method userinfo() I get 
>> "invalid token" error. See attached source code.
>> Can anyone help me with this? Thank you
>>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to