Skip to content
This repository has been archived by the owner on Nov 19, 2024. It is now read-only.

Commit

Permalink
Drop extra check of matching sub claims
Browse files Browse the repository at this point in the history
Don't want to introduce new behavior in this security fix
  • Loading branch information
josephdecock committed Nov 7, 2024
1 parent f3753bd commit 4aa9cc6
Showing 1 changed file with 0 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,6 @@ public async Task<UserToken> GetTokenAsync(
return new UserToken() { Error = "No properties on authentication result" };
}


// This "can't happen", but if it ever did, we would have a security problem
if (result.Principal.FindFirstValue(JwtClaimTypes.Subject) != user.FindFirstValue(JwtClaimTypes.Subject))
{
throw new InvalidOperationException("Mismatch between expected user identity and cached authenticate result");
}

return _tokensInProps.GetUserToken(result.Properties, parameters);
}

Expand Down

0 comments on commit 4aa9cc6

Please sign in to comment.