Class UserOAuthSubjectResolver
- Namespace
- MailFathom.Infrastructure.Security.OAuth
- Assembly
- MailFathom.Infrastructure.dll
Resolves the user a validated access token acts for, from the subject its issuer signed.
public sealed class UserOAuthSubjectResolver
- Inheritance
-
UserOAuthSubjectResolver
- Inherited Members
Remarks
A token proves which person an authorization server signed in and can prove nothing about whose mail that person reaches, because the server knows nothing about this deployment's users. The mapping is what supplies the missing half, and it is a credential row like every other: a user, a lookup composed from the issuer and the subject together, a grant, and an enabled state.
It is one indexed read rather than a scan of a document, which is what makes it usable on the path every token takes. The issuer travels with the subject because a subject is only meaningful beside the server 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.
A subject nothing maps is refused exactly as an unknown credential is, and so is one whose mapping is disabled. That is the whole of what this decides — it never widens a token to whoever the deployment serves, because a token admitted for nobody in particular is the arrangement the user axis exists to remove.
Constructors
- UserOAuthSubjectResolver(IUserCredentialStore)
Initializes a new resolver over one deployment's credential records.
Methods
- ResolveAsync(string?, string?, CancellationToken)
Reports which user one validated subject acts for.