Method TryReadIssuerAndSubject
- Namespace
- MailFathom.Infrastructure.Security.OAuth
- Assembly
- MailFathom.Infrastructure.dll
TryReadIssuerAndSubject(ClaimsIdentity, out string?, out string?)
Reads back the two halves an identity this type composed carries.
public static bool TryReadIssuerAndSubject(ClaimsIdentity identity, out string? issuer, out string? subject)
Parameters
identityClaimsIdentityThe identity FromValidatedToken(IEnumerable<Claim>, string) produced.
issuerstringThe authorization server that authenticated the person, when the identity names one.
subjectstringThat server's own identifier for them, when the identity names one.
Returns
Remarks
The joined value is what everything comparing an identity reads, and the halves are what a lookup keyed by the pair needs. Splitting it here rather than at that lookup is what keeps one place deciding how the two are joined: a caller that re-derived the subject by cutting at the separator would be reading a composition this type owns.
Exceptions
- ArgumentNullException
Thrown when
identityis null.