Table of Contents

Class UserPasswordAuthenticationResult

Namespace
MailFathom.Infrastructure.Security.Passwords
Assembly
MailFathom.Infrastructure.dll

The outcome of judging one presented username-and-password credential.

public sealed record UserPasswordAuthenticationResult : IEquatable<UserPasswordAuthenticationResult>
Inheritance
UserPasswordAuthenticationResult
Implements
Inherited Members

Remarks

A refused credential is an expected outcome of serving an open endpoint rather than an exceptional state, so authentication returns this instead of throwing. The successful result carries what every user-facing method establishes and nothing else: the credential's identifier, which an audit record and a diagnostic correlate on, the user the request will act for, what that request may do, and which endpoints that user's switches serve them on. The username is deliberately absent so nothing downstream can write one down.

Properties

Admitted

Gets what the request was admitted as, or null when the credential was refused.

Rejection

Gets why the credential was refused, or null when it authenticated.

Succeeded

Gets whether the presented credential authenticated.

Methods

Authenticated(Guid, UserId, IReadOnlyList<MailFathomPermission>, UserEndpointAccess, UserCredentialReach)

Creates a successful result naming the credential that matched and what it admits.

Rejected(UserPasswordRejection)

Creates a refused result.