[SDK-3172] Add ID Token validation to device-code and passwordless #553
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.
Our SDK validates ID Tokens for all but 3 method calls:
We should align the validation here and ensure the above methods also validate the ID Token.
Note that this is technically a breaking change ... Anyone retrieving an Invalid ID Token will be able to use the methods today, while after this change they suddenly get an exception when calling one of these methods.
However, I would argue this should be fine to release in a minor version, as anyone that we break here is made aware of the incorrect ID Token usage. When needed, they can still rollback to a version prior to this change if they need a fix ASAP and then circle back on fixing their incorrect ID Tokens. But regardless I would argue we want to push them into correct ID Token usage sooner rather than later.
Apart from the above, this should be backwards compatible and not require any change for anyone using valid ID Tokens.
What do you think @stevehobbsdev ?