Commit 5652ab16 authored by Edouard Lambert's avatar Edouard Lambert Committed by ntome

[OAuth2Mixin] add build_refresh_token_parameters method

add OAuth2Mixin 'build_refresh_token_parameters' method to
overwrite it if needed in browser's module.
parent 95ad1597
......@@ -1095,16 +1095,19 @@ class OAuth2Mixin(StatesMixin):
self.update_token(auth_response)
def use_refresh_token(self):
self.logger.info('refreshing token')
data = {
def build_refresh_token_parameters(self):
return {
'grant_type': 'refresh_token',
'refresh_token': self.refresh_token,
'client_id': self.client_id,
'client_secret': self.client_secret,
'redirect_uri': self.redirect_uri,
}
def use_refresh_token(self):
self.logger.info('refreshing token')
data = self.build_refresh_token_parameters()
try:
auth_response = self.do_token_request(data).json()
except ClientError:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment