Hacktoberfest 2026 : les issues que les mainteneurs ont marquées pour octobre, ouvertes et accessibles aux débutants. Parcourir les issues Hacktoberfest

OAuthClientProvider: no supported way to override endpoints or customize authorization state generation

Ouverte
#3,570 1 commentaire 0 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

Évaluation

Difficulté
3/5
Temps estimé
1-2 jours
Accessibilité débutants
65/100
Type d'issue
Fonctionnalité
Clarté
Clairement spécifiée
Activité
Active
Stack technique
python

Piste de recherche

Look at the OAuthClientProvider class in the codebase, likely in a file like oauth_client.py. Examine the _perform_authorization_code_grant method for state generation and the endpoint resolution logic. The work involves adding new optional parameters or hooks, then updating the flow to use them. Test by creating a subclass that overrides the new hook and supplies custom endpoints.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

Initial Checks
  • I confirm that I'm using the newest release of my line (verified on main and 2.2.0)
  • I confirm that I searched for my issue in the issues before opening this one (searched "custom oauth endpoints", "generate_auth_state", "state hook")
Release line

v2 (v1 shares the code)

Description

Two extensibility gaps in OAuthClientProvider for host applications that manage OAuth at scale (many servers, multi-tenant callbacks):

  1. Endpoint override. The endpoints used by the flow are only ever taken from discovery metadata or hard-coded fallbacks. A host that already knows the correct endpoints (admin-configured connectors, servers with broken or absent RFC 8414 metadata) has no supported way to supply them — subclassing private methods is the only route today. Proposal: an optional OAuthEndpoints value (authorization/token/registration endpoints) accepted by the provider and taking precedence over discovery.

  2. State generation hook. _perform_authorization_code_grant hard-codes state = secrets.token_urlsafe(32). A host that routes many callbacks through one shared redirect endpoint needs to bind the state value to its own session/tenant (e.g. a signed payload) while keeping the SDK's CSRF check. Proposal: an overridable generate_auth_state() hook defaulting to the current behavior.

Both are additive, no behavior change for existing users. We run both in production and can PR them — happy to be assigned.

🤖 Generated with Claude Code

Langage dominant
Python
Étoiles
24.3k
Forks
4k
Merge moyen
1 j 16 h
PR mergées (30 j)
25

Guide de contribution

Ouvrir le guide de contribution

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de modelcontextprotocol/python-sdk

Toutes les issues de modelcontextprotocol/python-sdk

Issues similaires

Plus d'issues Python

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.