Skip to content

Don't throw exception for token error response.#844

Merged
schlenk merged 2 commits intoCZ-NIC:masterfrom
zamzterz:handle-token-error-response
Feb 11, 2023
Merged

Don't throw exception for token error response.#844
schlenk merged 2 commits intoCZ-NIC:masterfrom
zamzterz:handle-token-error-response

Conversation

@zamzterz
Copy link
Contributor

  • Changes are covered by tests.

When upgrading the pyoidc dependency from 1.4.0 to 1.5.0 in Flask-pyoidc it revealed a breaking API change (by breaking this test): AHttpError exception is thrown for token error responses, without any possibility of recovering the error response.

This change brings back the behavior in 1.4.0 which returns the token error response allowing for further handling.

Copy link
Collaborator

@schlenk schlenk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Seems i missed the late conversion to the ErrorResponse type in the parse_response() code that runs only after this block, so the issubclass() failed for this case.

@schlenk schlenk merged commit f6c590c into CZ-NIC:master Feb 11, 2023
@zamzterz zamzterz deleted the handle-token-error-response branch February 11, 2023 15:17
@zamzterz
Copy link
Contributor Author

@schlenk Thanks for the quick response! Any chance of getting this in a patch release?

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.

2 participants