Authorization URL validations required by the OAuth 2.1 specification not implemented

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

Les mainteneurs répondent en général sous 1 jour

Personne n'a encore pris cette issue.

  • #3858 par @padraig-ohiceadha — fermée sans fusion

Évaluation

Difficulté
3/5
Temps estimé
Une demi-journée
Accessibilité débutants
35/100
Type d'issue
Bug
Clarté
Plutôt claire
Activité
À l'abandon
Stack technique
python
Domaine
authorization

Piste de recherche

Start in _perform_authorization_code_grant, where the authorization URL is built, and compare it with the existing resource URL validation the issue cites as a model. The change needs to reject URL fragments and reserved authorization request parameters, and to keep existing query parameters. Linked PR #3858 was closed without merging, so read its discussion before starting. Done means the checks run and existing OAuth tests still pass.

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

Description

bug v1 v2
Initial Checks
Release line

2.x (current stable)

Description

Similar to the existing handling of resource urls OAuth 2.1 requires that URL fragments not be included in the authorization url and that it not contain any of the params used by the authorization request. Neither of these are currently checked for in _perform_authorization_code_grant
The specification also requires that any existing query params are retained, which are not today ( there is an issue open of this particular part of the issue - https://github.com/modelcontextprotocol/python-sdk/issues/2776 ).

For the OAuth 2.1 specification requirements see section 3.1 of https://datatracker.ietf.org/doc/html/draft-ietf-oauth-v2-1#name-authorization-endpoint

Example Code

Python & MCP Python SDK
Python 3.11.9
2.3.1.dev20
Langage dominant
Python
Étoiles
25k
Forks
4.2k
Merge moyen
10 min
PR mergées (30 j)
1

Préparer son environnement

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.