Skip to content

Commit

Permalink
comments from review
Browse files Browse the repository at this point in the history
  • Loading branch information
Keegan Caruso committed Jun 20, 2023
1 parent 7fc29ae commit a630cc9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
namespace System.IdentityModel.Tokens.Jwt
{
/// <summary>
/// Static class to converts an object to a <see cref="JwtSecurityToken"/>
/// Static class to convert a <see cref="JsonWebToken"/> to a <see cref="JwtSecurityToken"/>
/// </summary>
public static class JwtSecurityTokenConverter
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,22 @@ public void JsonWebTokenToJwtSecurityTokenConversions(JwtSecurityTokenConverterT

public static TheoryData<JwtSecurityTokenConverterTheoryData> ConverterTheoryData()
{
var tdJwe = new SecurityTokenDescriptor
var tokenDescriptorJwe = new SecurityTokenDescriptor
{
SigningCredentials = KeyingMaterial.JsonWebKeyRsa256SigningCredentials,
EncryptingCredentials = KeyingMaterial.DefaultSymmetricEncryptingCreds_Aes256_Sha512_512,
Claims = Default.PayloadDictionary
};

var tdJws = new SecurityTokenDescriptor
var tokenDescriptorJws = new SecurityTokenDescriptor
{
SigningCredentials = KeyingMaterial.JsonWebKeyRsa256SigningCredentials,
Claims = Default.PayloadDictionary
};

var handler = new JsonWebTokenHandler();
var jweTokenString = handler.CreateToken(tdJwe);
var jwsTokenString = handler.CreateToken(tdJws);
var jweTokenString = handler.CreateToken(tokenDescriptorJwe);
var jwsTokenString = handler.CreateToken(tokenDescriptorJws);

var validationParameters = new TokenValidationParameters
{
Expand Down Expand Up @@ -103,7 +103,7 @@ public static TheoryData<JwtSecurityTokenConverterTheoryData> ConverterTheoryDat
foreach (var claim in jweTokenClaims)
{
Assert.True(otherTokenClaims.ContainsKey(claim.Key));
Assert.True(otherTokenClaims[claim.Key] == claim.Value);
Assert.Equal(otherTokenClaims[claim.Key], claim.Value);
}

}
Expand Down Expand Up @@ -131,7 +131,7 @@ public static TheoryData<JwtSecurityTokenConverterTheoryData> ConverterTheoryDat
foreach (var claim in jwsTokenFromStringClaims)
{
Assert.True(otherTokenClaims.ContainsKey(claim.Key));
Assert.True(otherTokenClaims[claim.Key] == claim.Value);
Assert.Equal(otherTokenClaims[claim.Key], claim.Value);
}
}
},
Expand All @@ -158,7 +158,7 @@ public static TheoryData<JwtSecurityTokenConverterTheoryData> ConverterTheoryDat
foreach (var claim in jwsTokenFromHeaderAndPayloadClaims)
{
Assert.True(otherTokenClaims.ContainsKey(claim.Key));
Assert.True(otherTokenClaims[claim.Key] == claim.Value);
Assert.Equal(otherTokenClaims[claim.Key], claim.Value);
}
}
}
Expand Down

0 comments on commit a630cc9

Please sign in to comment.