Hacktoberfest 2026: as issues que os mantenedores marcaram para outubro, abertas e boas para iniciantes. Ver issues do Hacktoberfest

pushed_authorization_request sends list authorization_details as a Python repr

Aberta Para iniciantes
#903 0 comentários 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

@RaphaelFakhri já está trabalhando nisso.

Desde 19/10/2026.

  • #904 de @RaphaelFakhri — aberto

Avaliação

Dificuldade
2/5
Tempo estimado
1-3 horas
Facilidade para iniciantes
78/100
Tipo de issue
Bug
Clareza
Claramente especificada
Status de atividade
Ativa
Stack de tecnologia
python
Domínio
api

Direção de pesquisa

Comece com PushedAuthorizationRequests.pushed_authorization_request() e o teste existente test_with_authorization_details mencionado na issue. Compare como RestClient._request() codifica valores de lista com a correção de BackChannelLogin.back_channel_login() em #695. A tarefa estará concluída quando o corpo do formulário contiver authorization_details como um array JSON com aspas duplas quando uma lista for passada.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

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

Linguagem predominante
Python
Estrelas
578
Forks
190
Merge médio
9h 39min
PRs com merge (30d)
7

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de auth0/auth0-python

Todas as issues de auth0/auth0-python

Issues semelhantes

Mais issues de Python

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.