2

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

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

此令牌仅在一个小时内有效。刷新令牌存储在哪里?

4

1 回答 1

2

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

account = user.socialaccount_set.get(provider="bitbucket_oauth2")
refresh_token = account.socialtoken_set.first().token_secret
于 2016-04-20T22:21:56.480 回答