我试图使用从django-social-auth获取的OAuth令牌访问用户日历。从Google数据API(日历)使用django-social-auth的OAuth访问令牌
所以在Django的社会验证配置我设置:
GOOGLE_CONSUMER_KEY = 'anonymous'
GOOGLE_CONSUMER_SECRET = 'anonymous'
GOOGLE_OAUTH_EXTRA_SCOPE = ['https://www.google.com/calendar/feeds/']
当用户从谷歌回来了,我在数据库中保存其中lookes这样的条目:
{u'access_token': u'oauth_token_secret=vvvv&oauth_token=xxxx'}
但是现在,当我尝试做这样的事情:
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()
我总是得到:
gdata.client.Unauthorized: Unauthorized - Server responded with: 401
<HEAD>
<TITLE>Token invalid - Invalid AuthSub token.</TITLE>
</HEAD>
我在这里错过了什么?
你使用OAuth或OAuth2用户? –
我有完全相同的问题。使我抓狂。我正在使用OAuth,并尝试使用匿名以及注册密钥。 – Tony