Table of Contents

Class ClaimsPrincipalSubject

Namespace
Arc4u.OAuth2
Assembly
Arc4u.OAuth2.dll

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

first ClaimsPrincipal

The first principal.

second ClaimsPrincipal

The second principal.

Returns

bool

false when the principals are proven to belong to different users; otherwise true.

Exceptions

ArgumentNullException

first or second is null.