Table of Contents

Class HouseholdIdentifierResolver

Namespace
SEBT.Portal.Infrastructure.Services
Assembly
SEBT.Portal.Infrastructure.dll

Resolves the preferred household identifier from the authenticated user. For states that do not persist PII, phone can be resolved from the JWT only. In Development, a configured phone override (DevelopmentPhoneOverride:Phone) takes precedence over JWT/user.

public class HouseholdIdentifierResolver : IHouseholdIdentifierResolver
Inheritance
object
HouseholdIdentifierResolver
Implements

Constructors

HouseholdIdentifierResolver(IOptionsSnapshot<StateHouseholdIdSettings>, IUserRepository, IPhoneOverrideProvider, ILogger<HouseholdIdentifierResolver>?)

public HouseholdIdentifierResolver(IOptionsSnapshot<StateHouseholdIdSettings> settingsSnapshot, IUserRepository userRepository, IPhoneOverrideProvider phoneOverrideProvider, ILogger<HouseholdIdentifierResolver>? logger = null)

Parameters

settingsSnapshot IOptionsSnapshot<StateHouseholdIdSettings>
userRepository IUserRepository
phoneOverrideProvider IPhoneOverrideProvider
logger ILogger<HouseholdIdentifierResolver>

Methods

ResolveAsync(ClaimsPrincipal, CancellationToken)

Resolves the preferred household identifier for the given user based on current state configuration.

public Task<HouseholdIdentifier?> ResolveAsync(ClaimsPrincipal principal, CancellationToken cancellationToken = default)

Parameters

principal ClaimsPrincipal
cancellationToken CancellationToken

Optional cancellation token.

Returns

Task<HouseholdIdentifier>

The first preferred household identifier that can be resolved from the user's claims, or null if none is available.