Split _perform_authorization_code_grant code #1815
Open
+17
−8
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.
Description
The goal of this PR is to be able to reuse the function to create authorization url. Currently, it is not possible as the url is built in the same function that also handles callback functions.
Motivation and Context
It is pretty comfortable to inherit from
OAuthClientProviderwhen we want to create a specific client for a MCP server. However, we may not want to use the workflow that uses callbacks to authenticate, but rather build the authorization URL, send it to frontend, have our owncallbackurl, and then proceed to code exchange.For the moment, we have to reimplement the URL creation as it the code is located inside the same function that uses callbacks.
This change also brings more separation into a long function.
How Has This Been Tested?
These changes are minimal, and is just separating a function into 2 parts. I don't think some specific new tests are needed, but if it is needed, I would be happy to test this new function
Breaking Changes
None
Types of changes
Checklist