-
Notifications
You must be signed in to change notification settings - Fork 413
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
Fix empty x5c header on JwtHeader #2460
Conversation
GetStandardHeader is used for first class properties on JwtHeader, one of these first class properties can be an array. Refactor to accomadate this. MultipleX5C test didn't properly exercise the header x5c API. Another test was added to show x5c can be roundtripped as well as that the value is equivalent between being fetched from a JwtSecurityToken or a JsonWebToken
@@ -80,7 +80,7 @@ public static Exception CreateJsonReaderExceptionInvalidType(ref Utf8JsonReader | |||
LogHelper.MarkAsNonPII(reader.BytesConsumed))); | |||
} | |||
|
|||
public static JsonElement CreateJsonElement(List<string> strings) | |||
public static JsonElement CreateJsonElement(IList<string> strings) |
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.
can we avoid the IList
? #2242 (comment)
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.
IList covers a lot of types...
JsonElement json = JsonPrimitives.CreateJsonElement(stringList); | ||
return json.ToString(); | ||
} | ||
|
||
// TODO - review dev | ||
return string.Empty; |
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.
do you know what this is for?
test/System.IdentityModel.Tokens.Jwt.Tests/CreateAndValidateTokens.cs
Outdated
Show resolved
Hide resolved
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.
GetStandardClaim is used for first class
properties on JwtHeader, one of these first class
properties can be an array. Refactor to accomadate this.
MultipleX5C test didn't properly exercise the
header x5c API.
Another test was added to show x5c can be
roundtripped as well as that the value is equivalent between being fetched from a JwtSecurityToken or a JsonWebToken
Fixes #2447