requests-oauthlib icon indicating copy to clipboard operation
requests-oauthlib copied to clipboard

Doesn't allow custom grant types

Open fparra-adv opened this issue 5 years ago • 0 comments

I am trying to use the refresh_token method to get an access token and getting this error.

The API I am using requires that I use the value "refresh_token" for grant type when requesting an access token. When creating an object it always starts with a grant type of 'authorization_code'.

prepare_token_request() got multiple values for argument 'grant_type'

kwargs = { 'grant_type': 'refresh_token', 'preserve_refresh_token': True, 'client_id': client_id, 'client_secret' : client_secret }

auth =OAuth2Session()


access_token  = auth.refresh_token(token_url=token_url, refresh_token= refresh_token,  **kwargs)

fparra-adv avatar Aug 28 '20 15:08 fparra-adv