Table of Contents

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

issuer string

The issuer exactly as the token carried it.

subject string

The subject claim the token carried.

lookup UserCredentialLookup

The composed lookup, or the unspecified default when the pair cannot be one.

Returns

bool

true when the pair composes a lookup this deployment can store and resolve.

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.