Support non-x-www-form-urlencoded bodies returned from refresh_token_request compliance hook #545
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Addresses #544
Adding similar capabilities to the
refresh_token_request
compliance hook as is possible in theaccess_token_request
hook, to allow for non standard, nonx-www-form-urlencoded
request bodies in token refresh requests.Additionally, adding in a Wix compliance fix showing how to use the
access_token_request
andrefresh_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-tokenI 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 intest_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.