Skip to content

fix: send authorization_details as JSON in pushed_authorization_request - #904

Open
RaphaelFakhri wants to merge 1 commit into
auth0:masterfrom
RaphaelFakhri:fix/par-authorization-details-json
Open

RaphaelFakhri wants to merge 1 commit into
auth0:masterfrom
RaphaelFakhri:fix/par-authorization-details-json

Conversation

@RaphaelFakhri

Copy link
Copy Markdown

Changes

PushedAuthorizationRequests.pushed_authorization_request() sends its body as application/x-www-form-urlencoded. When authorization_details is passed as a list, urlencode() writes the Python repr of the list ([{'type': 'money_transfer', ...}], single-quoted) instead of JSON. That is not the JSON array that RFC 9396 requires for authorization_details.

This change serializes a list authorization_details with json.dumps() before the request is sent, the same way BackChannelLogin.back_channel_login() already does (#695). String values pass through unchanged.

  • Methods changed: PushedAuthorizationRequests.pushed_authorization_request() (no signature change)
  • test_with_authorization_details now expects the JSON string.
  • New test_authorization_details_sent_as_json checks the encoded request body that reaches requests.request.

References

Testing

poetry run pytest tests/authentication/test_pushed_authorization_requests.py: 5 passed. Without the source change, test_with_authorization_details and test_authorization_details_sent_as_json fail. poetry run pytest tests/authentication: 113 passed.

Not tested against a live tenant.

  • This change adds unit test coverage
  • This change adds integration test coverage

@RaphaelFakhri
RaphaelFakhri requested a review from a team as a code owner October 19, 2026 08:00

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pushed_authorization_request sends list authorization_details as a Python repr

1 participant