Skip to content

Fix empty x5c header on JwtHeader#2460

Merged
keegan-caruso merged 3 commits into
devfrom
kecaruso/2447
Jan 27, 2024
Merged

Fix empty x5c header on JwtHeader#2460
keegan-caruso merged 3 commits into
devfrom
kecaruso/2447

Conversation

@keegan-caruso

@keegan-caruso keegan-caruso commented Jan 26, 2024

Copy link
Copy Markdown
Contributor

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

Keegan Caruso added 2 commits January 26, 2024 14:06
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
}

public static JsonElement CreateJsonElement(List<string> strings)
public static JsonElement CreateJsonElement(IList<string> strings)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IList

can we avoid the IList? #2242 (comment)

Copy link
Copy Markdown
Contributor Author

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...

}

// TODO - review dev
return string.Empty;

Copy link
Copy Markdown
Contributor

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?

Comment thread test/System.IdentityModel.Tokens.Jwt.Tests/CreateAndValidateTokens.cs Outdated
Comment thread test/System.IdentityModel.Tokens.Jwt.Tests/JwtHeaderTests.cs Outdated
Comment thread test/System.IdentityModel.Tokens.Jwt.Tests/JwtHeaderTests.cs Outdated

@jennyf19 jennyf19 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] x5c property is empty in JwtHeader after reading a JWT containing x5c in its header

3 participants