Authorization URL validations required by the OAuth 2.1 specification not implemented

Đang mở
#3,856 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

  • #3858 của @padraig-ohiceadha — đã đóng, không merge

Đánh giá

Độ khó
3/5
Thời gian dự kiến
Nửa ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
python
Lĩnh vực
authorization

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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
Ngôn ngữ chính
Python
Star
25k
Fork
4.2k
Merge trung bình
10 phút
Pull request đã merge (30 ngày)
1

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của modelcontextprotocol/python-sdk

Tất cả issue của modelcontextprotocol/python-sdk

Issue tương tự

Thêm issue về Python

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.