public static JwtSecurityToken CreateJwtSecurityToken(string issuer = null, string originalIssuer = null) { string iss = issuer ?? Default.Issuer; string originalIss = originalIssuer ?? Default.OriginalIssuer; return(new JwtSecurityToken(issuer, "http://www.contoso.com", ClaimSets.Simple(iss, originalIss))); }
public void CompareJwtPayload() { TestUtilities.WriteHeader($"{this}.CompareJwtPayload", true); var context = new CompareContext($"{this}.CompareJwtPayload"); var jwtPayload1 = new JwtPayload(ClaimSets.DefaultClaimsAsCreatedInPayload()); var jwtPayload2 = new JwtPayload(); IdentityComparer.AreEqual(jwtPayload1, jwtPayload2, context); Assert.True(context.Diffs.Count(s => s == "Aud:") == 1); Assert.True(context.Diffs.Count(s => s == "Claims:") == 1); }