Class ClaimsPrincipalSubject
Tells whether two principals belong to the same user, from the claims that identify the user.
public static class ClaimsPrincipalSubject
- Inheritance
-
ClaimsPrincipalSubject
- Inherited Members
Methods
IsSameSubject(ClaimsPrincipal, ClaimsPrincipal)
Returns false when an identifier claim (sub, oid, or their mapped forms) present in both principals has
different values. When no identifier claim can be compared, the principals are considered to belong to the same user: the check only
detects a proven mismatch.
public static bool IsSameSubject(ClaimsPrincipal first, ClaimsPrincipal second)
Parameters
firstClaimsPrincipalThe first principal.
secondClaimsPrincipalThe second principal.
Returns
Exceptions
- ArgumentNullException
firstorsecondis null.