Catch OAuth providers that want the params sent as data (#800)

This commit is contained in:
Michael LoSapio 2017-05-25 13:21:29 -04:00 committed by kevgliss
parent 31f4cf0253
commit 3141b47fba
1 changed files with 3 additions and 0 deletions

View File

@ -279,7 +279,10 @@ class OAuth2(Resource):
}
# exchange authorization code for access token.
# Try Params first
r = requests.post(access_token_url, headers=headers, params=params)
if r.status_code == 400:
r = requests.post(access_token_url, headers=headers, data=params)
id_token = r.json()['id_token']
access_token = r.json()['access_token']