Skip to content

Conversation

@HenriChabert
Copy link

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 OAuthClientProvider when 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 own callback url, 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

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant