Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Add OAuth authentication client for HTTPX #751

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 19 commits into from
May 19, 2025
Merged

Add OAuth authentication client for HTTPX #751

merged 19 commits into from
May 19, 2025

Conversation

ihrpr
Copy link
Contributor

@ihrpr ihrpr commented May 19, 2025

Adding support for Auth in client using HTTPX Custom authentication schemes
.

NOTE: This PR adds support for Streamable HTTP, but SSE will be added as a follow up, all we need to do is to add one parameter.

This PR Implements Auth in spec version 2025-03-26

  • Implementation supporting dynamic client registration, authorization flow, and automatic token refresh
  • Pluggable Storage System - Support for different token storage backends (in-memory and file-based providers included)
  • Streamable HTTP Integration - OAuth authentication integrated with the existing streamable HTTP transport
  • Example Client - A complete working example demonstrating OAuth authentication flow with an interactive CLI

Follow ups:

  • add support for SSE

Related Issues:
#652
Related PRs:
#700
#308

Copy link
Contributor

@pcarleton pcarleton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor nits, i also pushed a commit for scope handling.

I tested this against the typescript example, and it successfully connected after the scope fix

@ihrpr ihrpr requested a review from pcarleton May 19, 2025 11:13
pcarleton
pcarleton previously approved these changes May 19, 2025
Copy link
Contributor

@pcarleton pcarleton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

think it's upset about some linting errors. but otherwise lgtm!

@aravind-segu
Copy link

@ihrpr Thank you very much for working on this request quickly! The OAuth implementation looks great and works well for our use case. With the Token Storage Provider in place, as long as the contract is maintained, we can also bypass the 3-legged OAuth flow and connect to MCP servers using an internally generated OAuth token - which is also perfect for us.

@ihrpr ihrpr merged commit e33cd41 into main May 19, 2025
13 checks passed
@ihrpr ihrpr deleted the ihrpr/auth branch May 19, 2025 19:38
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.

3 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.