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

OAuthService.loadDiscoveryDocumentAndLogin results in ERROR URIError: URI malformed #1439

Open
mdbel opened this issue Sep 18, 2024 · 0 comments

Comments

@mdbel
Copy link

mdbel commented Sep 18, 2024

If you have an Url hash with encoded special characters (%,&,?, ...), the URI malformed error will be thrown when calling OAuthService:loadDiscoveryDocumentAndLogin without providing a custom hash fragment.
After some code analysis I noticed that this was due to double decoding of the hash fragment:

  • getCodePartsFromUrl calls this.urlHelper.getHashFragmentParams(); if no queryString (no customHashFragment or window.location.search)
  • getHashFragmentParams first decodes window.location.hash and then executes this.parseQueryString(hash) with that decoded hash,
  • parseQueryString decodes the url hash again (see value = decodeURIComponent(escapedValue));, which results in ERROR URIError: URI malformed
Screenshot 2024-09-18 at 11 06 35
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

1 participant