Skip to content

OAuth Dynamic Client Registration does not include refresh_token grant type #3078

Description

@fredericlefeurmou

Description

When ToolHive dynamically registers OAuth clients (RFC 7591), it only requests the authorization_code grant type. This causes token refresh to fail after the initial access token expires (~30-60 minutes) because the OAuth server rejects refresh token requests with:

"The OAuth 2.0 Client is not allowed to use authorization grant 'refresh_token'"

Steps to Reproduce

  1. Configure a remote MCP server with OAuth (e.g., Glean)
  2. Run thv run to start the MCP server
  3. Wait ~30-60 minutes for the initial access token to expire
  4. Observe the token refresh fails with the error above

Expected Behavior

Token refresh should work, allowing long-running MCP sessions to maintain authentication.

Proposed Solution

Add refresh_token to the grant_types array in the Dynamic Client Registration request alongside authorization_code.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    authenticationbugSomething isn't workinggoPull requests that update go code

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions