requests-oauthlib
requests-oauthlib copied to clipboard
Support non-x-www-form-urlencoded bodies returned from refresh_token_request compliance hook
Addresses https://github.com/requests/requests-oauthlib/issues/544
Adding similar capabilities to the refresh_token_request
compliance hook as is possible in the access_token_request
hook, to allow for non standard, non x-www-form-urlencoded
request bodies in token refresh requests.
Additionally, adding in a Wix compliance fix showing how to use the access_token_request
and refresh_token_request
compliance hooks to successfully request and refresh tokens with Wix. Docs here: https://dev.wix.com/docs/rest/app-management/oauth-2/request-an-access-token
I added tests for the compliance fix to show the refresh_token_request
updates work (as well as testing them manually against the Wix API from my own project). I'm happy to add tests in test_oauth2_session.py
as well, I just wasn't sure exactly what to add, as the code I added should only ever be triggered by compliance hooks changing the request body to something non-standard.
I am also open to a completely different implementation here, this was just the option that I saw would solve my problem and looked to be fully backwards compatible with anyone's existing refresh_token_request
compliance hooks.