Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aliri_oauth2::Authority::new_from_url errors if an unknown algorithm is encountered #11

Closed
netthier opened this issue May 5, 2022 · 2 comments · Fixed by #13
Closed

Comments

@netthier
Copy link

netthier commented May 5, 2022

Even if multiple algorithms are offered, the deserialization of the response will fail if any unsupported algorithm is offered.
My Keycloak server provides both RS256 and RSA-OAEP algorithms.
Running

let authority =
        aliri_oauth2::Authority::new_from_url("https://example.com/auth/realms/master/protocol/openid-connect/certs", oauth_validator)
            .await?;

fails with

Error: error decoding response body: data did not match any variant of untagged enum Algorithm at line 1 column 90

with column 90 containing "alg": "RSA-OAEP"

@netthier
Copy link
Author

netthier commented May 5, 2022

Disabling RSA-OAEP in Keycloak fixes this issue, but I think there should be a way to handle unknown algorithms in aliri.

@neoeinstein
Copy link
Owner

That certainly sounds reasonable. I may be able to add something in to identify that it is an unsupported key type and log a warning, but continue operating normally.

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 a pull request may close this issue.

2 participants