Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

pushed_authorization_request sends list authorization_details as a Python repr

Offen Anfängerfreundlich
#903 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

@RaphaelFakhri arbeitet bereits daran.

Seit 19.10.2026.

  • #904 von @RaphaelFakhri — offen

Bewertung

Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Anfängerfreundlichkeit
78/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
python
Bereich
api

Rechercherichtung

Beginne mit PushedAuthorizationRequests.pushed_authorization_request() und dem bestehenden Test test_with_authorization_details, der im Issue genannt wird. Vergleiche, wie RestClient._request() Listenwerte kodiert, mit der Korrektur in BackChannelLogin.back_channel_login() in #695. Fertig ist die Änderung, wenn der Formularkörper authorization_details als JSON-Array mit doppelten Anführungszeichen enthält, wenn eine Liste übergeben wird.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

Checklist
  • I have looked into the README and have not found a suitable solution or answer.
  • I have searched the issues and have not found a suitable solution or answer.
Description

PushedAuthorizationRequests.pushed_authorization_request() posts a form-encoded body (Content-Type: application/x-www-form-urlencoded). RestClient._request() converts the payload with urllib.parse.urlencode(), which turns a list value into its Python repr.

When you pass authorization_details as a list, which the existing test test_with_authorization_details does, the request body contains:

authorization_details=%5B%7B%27type%27%3A+%27money_transfer%27%2C+...

That decodes to [{'type': 'money_transfer', ...}], with single quotes, which is not JSON. RFC 9396 requires authorization_details to be a JSON array, so RAR through PAR does not work with a list.

BackChannelLogin.back_channel_login() had the same problem and was fixed in #695 by calling json.dumps() on list values.

Reproduction
from unittest import mock
from urllib.parse import parse_qs
from auth0.authentication.pushed_authorization_requests import PushedAuthorizationRequests

with mock.patch("requests.request") as req:
    req.return_value.status_code = 201
    req.return_value.text = '{"request_uri": "urn:x", "expires_in": 30}'
    PushedAuthorizationRequests("my.domain.com", "cid", client_secret="s").pushed_authorization_request(
        response_type="code",
        redirect_uri="https://example.com/cb",
        authorization_details=[{"type": "money_transfer"}],
    )
    print(parse_qs(req.call_args.kwargs["data"])["authorization_details"])
# ["[{'type': 'money_transfer'}]"]

Expected: ['[{"type": "money_transfer"}]'].

Additional context

Workaround: pass authorization_details=json.dumps([...]).

auth0-python version

6.8.0 (main at 9aae3e5)

Python version

3.12

Vorherrschende Sprache
Python
Sterne
578
Forks
190
Ø Merge
9 Std. 39 Min.
Gemergte PRs (30 T.)
7

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus auth0/auth0-python

Alle Issues in auth0/auth0-python

Ähnliche Issues

Weitere Issues zu Python

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.