Don't validate id_token when alg is HS256 and there is no clientSecret #330
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.
fix #329
Changes
In 2.13.0 we added ID token validation, but there are old tenants that return HS256 id_tokens. Since this library doesn't require the
clientSecret
param and the client secret is needed to validate HS256 id_tokens, the validation fails with an exception. This PR bypasses the validation when the id_token is HS256 and there is no client secret (it will emit a console.warn).References
#295
Testing
Please describe how this can be tested by reviewers. Be specific about anything not tested and reasons why. If this library has unit and/or integration testing, tests should be added for new functionality and existing tests should complete without errors.
[x] This change adds unit test coverage
[ ] This change adds integration test coverage
Checklist
[x] I have read the Auth0 general contribution guidelines
[x] I have read the Auth0 Code of Conduct
[x] All existing and new tests complete without errors