Skip to content

Decoding id_token in code flow results in URIError: URI malformed #1464

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

Open
PuffPastry opened this issue Feb 12, 2025 · 3 comments
Open

Decoding id_token in code flow results in URIError: URI malformed #1464

PuffPastry opened this issue Feb 12, 2025 · 3 comments

Comments

@PuffPastry
Copy link

This error appears on login and on refresh. I am using Authentik as my odic provider.

The Stacktrace is:

core.mjs:6673 ERROR URIError: URI malformed
at decodeURIComponent ()
at b64DecodeUnicode (angular-oauth2-oidc.mjs:151:10)
at _OAuthService.processIdToken (angular-oauth2-oidc.mjs:2335:24)
at Object.next (angular-oauth2-oidc.mjs:2159:16)
...

The error happens in chrome and safari.

@PuffPastry
Copy link
Author

I can give a little further info: it appears that what was sent is a jwe token, so the payload is encrypted and therefore this algo fails at that point.

The fact that it is a jwe is in the header: {"alg":"RSA-OAEP-256","enc":"A256CBC-HS512","kid":"xxx","typ":"JWE"}

This should result in a different decoding being used.

@adityachandelgit
Copy link

@PuffPastry Facing same problem. Were you able to find a solution?

@PuffPastry
Copy link
Author

I've circumvented it by not encrypting the payload in the oidc server.. not really a solution 😕 but I can sign in now

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

No branches or pull requests

2 participants