Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django-allauth OAuth2 refresh token

When using django-allauth to do OAuth2 authentication, I can find the OAuth token using the following (bitbucket_oauth2 is the provider in the example):

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

This token is only valid for an hour. Where is the refresh token stored?

like image 768
Zags Avatar asked Sep 12 '26 12:09

Zags


1 Answers

The refresh token can be found in:

account = user.socialaccount_set.get(provider="bitbucket_oauth2")
refresh_token = account.socialtoken_set.first().token_secret
like image 138
Zags Avatar answered Sep 14 '26 07:09

Zags