fix: make issuer url validation follow the same check rules as the domain url validator #1291
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes
This change makes the URL validation on
getTokenIssuer
atutil.ts
follow the same protocol validation rules as the functiongetDomain
in the same file. I propose this change because, in case this library is used with other oauth providers, the issuer claim might have their protocol ashttp
instead ofhttps
, resulting in this function appendinghttps
to an already well formed URL.This is a problem that is actually impacting one of my applications in a development environment, the fix doesn't disrupt the current functionality but takes the validation that already exists for the domain URL. There are no UI changes, nor public API changes, only to one internal function.
A similar problem has been reported here before: https://community.auth0.com/t/invalid-id-token-issuer-iss-claim-mismatch-in-the-id-token/107904
If approved, I'd appreciate if this change could go in a patch release :)
References
Testing
Checklist