Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

pushed_authorization_request sends list authorization_details as a Python repr

Aperta Adatta ai principianti
#903 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@RaphaelFakhri ci sta già lavorando.

Dal 19/10/2026.

  • #904 di @RaphaelFakhri — aperta

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
78/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
python
Ambito
api

Direzione di ricerca

Inizia con PushedAuthorizationRequests.pushed_authorization_request() e il test esistente test_with_authorization_details menzionato nell’issue. Confronta il modo in cui RestClient._request() codifica i valori delle liste con la correzione di BackChannelLogin.back_channel_login() in #695. Il lavoro è terminato quando il corpo del modulo contiene authorization_details come array JSON con virgolette doppie quando viene passata una lista.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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

Lingua principale
Python
Stelle
578
Fork
190
Merge medio
9h 39m
PR unite (30g)
7

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di auth0/auth0-python

Tutte le issue di auth0/auth0-python

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.