Method TryCreateForOAuthSubject
- Namespace
- MailFathom.Domain.Access
- Assembly
- MailFathom.Domain.dll
TryCreateForOAuthSubject(string?, string?, out UserCredentialLookup)
Composes the value an authorization server's validated subject is resolved by.
public static bool TryCreateForOAuthSubject(string? issuer, string? subject, out UserCredentialLookup lookup)
Parameters
issuerstringThe issuer exactly as the token carried it.
subjectstringThe subject claim the token carried.
lookupUserCredentialLookupThe composed lookup, or the unspecified default when the pair cannot be one.
Returns
Remarks
The two are held together rather than as one value each, because a subject is only ever meaningful beside the issuer that minted it: two servers may name two different people identically, and a mapping keyed by the subject alone would let one of them act for the other's user. An issuer carrying a space is refused, since that is what separates the halves — it cannot arise from an absolute URI, and refusing it is what keeps the reading of a stored value unambiguous.