Support multiple audiences in JWT token - #68
Merged
Merged
Conversation
kitsunet
approved these changes
Jun 30, 2025
Member
|
Thank you so much, that is a great addition, sorry for taking a a while! |
Member
|
Any veto @robertlemke @kdambekalns ? Would otherwise merge soon. |
The audience check now lives in IdentityToken::audienceContains(). It accepts an "aud" claim with a single string or with an array of strings and compares the values strictly. A loose in_array() treats numeric strings as numbers in PHP 8, so "1e3" would match an expected audience of "1000". A security check should not depend on such conversions. Moving the check out of the authentication provider also makes it testable without a Flow object manager.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #68 +/- ##
============================================
+ Coverage 22.99% 23.64% +0.65%
- Complexity 228 231 +3
============================================
Files 10 10
Lines 587 592 +5
============================================
+ Hits 135 140 +5
Misses 452 452 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Allow the JWT token to have multiple audiences