Kai*_*Kai 5 django oauth gdata google-data-api django-socialauth
我正在尝试使用我从django-social-auth获取的OAuth令牌来访问用户日历.
所以在我设置的django-social-auth配置中:
GOOGLE_CONSUMER_KEY = 'anonymous'
GOOGLE_CONSUMER_SECRET = 'anonymous'
GOOGLE_OAUTH_EXTRA_SCOPE = ['https://www.google.com/calendar/feeds/']
Run Code Online (Sandbox Code Playgroud)
当用户从谷歌回来时,我在数据库中得到一个如下所示的条目:
{u'access_token': u'oauth_token_secret=vvvv&oauth_token=xxxx'}
Run Code Online (Sandbox Code Playgroud)
但现在,当我尝试做这样的事情时:
import gdata.calendar.client
client = gdata.calendar.client.CalendarClient()
client.auth_token = gdata.gauth.OAuthHmacToken('anonymous', 'anonymous', 'xxxx', 'vvvv', gdata.gauth.ACCESS_TOKEN)
client.GetOwnCalendarsFeed()
Run Code Online (Sandbox Code Playgroud)
我总是得到:
gdata.client.Unauthorized: Unauthorized - Server responded with: 401
<HEAD>
<TITLE>Token invalid - Invalid AuthSub token.</TITLE>
</HEAD>
Run Code Online (Sandbox Code Playgroud)
我在这里错过了什么?
| 归档时间: |
|
| 查看次数: |
2780 次 |
| 最近记录: |