Django-allauth OAuth2 刷新令牌

Django-allauth OAuth2 refresh token

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

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

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

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

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