-
Notifications
You must be signed in to change notification settings - Fork 28
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
Improvement/audience can accept list of string #7
base: master
Are you sure you want to change the base?
Improvement/audience can accept list of string #7
Conversation
Audience now accepts either a single string or a list of strings
Codecov Report
@@ Coverage Diff @@
## master #7 +/- ##
========================================
+ Coverage 99.1% 100% +0.89%
========================================
Files 1 1
Lines 112 113 +1
========================================
+ Hits 111 113 +2
+ Misses 1 0 -1
Continue to review full report at Codecov.
|
Would you be willing to rebase this PR from latest master so that conflicts are resolved? |
@@ -133,7 +133,7 @@ class JWT { | |||
String get issuer => _claims['iss']; | |||
|
|||
/// The audience of this token (value of standard `aud` claim). | |||
String get audience => _claims['aud']; | |||
List<String> get audience => _claims['aud'].cast<String>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to spec audience can either be a list or a single string value.
It seems that we should preserve this, which means having audience
type as Object
+ updating dartdoc for the property to describe possible return values.
WDYT?
_claims['aud'] = [audience]; | ||
} else if (audience is List<String>) { | ||
_claims['aud'] = audience; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similarly here, if someone wants to set aud
as a single string we shouldn't force it to be an array.
Because some oAuth2 and OIDC services can also return a list of audiences, not just a String.
Example: https://github.com/ory/hydra