Skip to content

Commit e6d316e

Browse files
Removed unused property on JsonWebToken (#3072)
1 parent e725d0e commit e6d316e

File tree

1 file changed

+0
-58
lines changed

1 file changed

+0
-58
lines changed

src/Microsoft.IdentityModel.JsonWebTokens/JsonWebToken.cs

Lines changed: 0 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@ public partial class JsonWebToken : SecurityToken
1919
{
2020
internal const string ClassName = "Microsoft.IdentityModel.JsonWebTokens.JsonWebToken";
2121

22-
private ClaimsIdentity _claimsIdentity;
23-
private bool _wasClaimsIdentitySet;
24-
2522
private string _act;
2623
private string _authenticationTag;
2724
private string _ciphertext;
@@ -629,61 +626,6 @@ public Claim GetClaim(string key)
629626
/// </summary>
630627
internal IReadOnlyCollection<string> PayloadClaimNames => Payload._jsonClaims.Keys;
631628

632-
internal ClaimsIdentity ClaimsIdentity
633-
{
634-
get
635-
{
636-
if (!_wasClaimsIdentitySet)
637-
{
638-
_wasClaimsIdentitySet = true;
639-
string actualIssuer = ActualIssuer ?? Issuer;
640-
641-
foreach (Claim claim in Claims)
642-
{
643-
string claimType = claim.Type;
644-
if (claimType == ClaimTypes.Actor)
645-
{
646-
if (_claimsIdentity.Actor != null)
647-
throw LogHelper.LogExceptionMessage(new InvalidOperationException(LogHelper.FormatInvariant(LogMessages.IDX14112, LogHelper.MarkAsNonPII(JwtRegisteredClaimNames.Actort), claim.Value)));
648-
649-
#pragma warning disable CA1031 // Do not catch general exception types
650-
try
651-
{
652-
JsonWebToken actorToken = new JsonWebToken(claim.Value);
653-
_claimsIdentity.Actor = ActorClaimsIdentity;
654-
}
655-
catch
656-
{
657-
658-
}
659-
#pragma warning restore CA1031 // Do not catch general exception types
660-
}
661-
662-
if (claim.Properties.Count == 0)
663-
{
664-
_claimsIdentity.AddClaim(new Claim(claimType, claim.Value, claim.ValueType, actualIssuer, actualIssuer, _claimsIdentity));
665-
}
666-
else
667-
{
668-
Claim newClaim = new Claim(claimType, claim.Value, claim.ValueType, actualIssuer, actualIssuer, _claimsIdentity);
669-
670-
foreach (var kv in claim.Properties)
671-
newClaim.Properties[kv.Key] = kv.Value;
672-
673-
_claimsIdentity.AddClaim(newClaim);
674-
}
675-
}
676-
}
677-
678-
return _claimsIdentity;
679-
}
680-
681-
set
682-
{
683-
_claimsIdentity = value;
684-
}
685-
}
686-
687629
/// <summary>
688630
/// Try to get a <see cref="Claim"/> representing the { key, 'value' } pair corresponding to the provided <paramref name="key"/>.
689631
/// The value is obtained from the Payload.

0 commit comments

Comments
 (0)