Django-allauth OAuth2刷新令牌

时间:2016-04-20 22:21:56

标签: django django-allauth oauth2

使用django-allauth进行OAuth2身份验证时,我可以使用以下命令找到OAuth令牌(bitbucket_oauth2是示例中的提供者):

account = user.socialaccount_set.get(provider="bitbucket_oauth2")
token = account.socialtoken_set.first().token

此令牌仅在一小时内有效。 refresh token存储在哪里?

1 个答案:

答案 0 :(得分:1)

可以在以下位置找到刷新令牌:

account = user.socialaccount_set.get(provider="bitbucket_oauth2")
refresh_token = account.socialtoken_set.first().token_secret
相关问题