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
-
objectHouseholdIdentifierResolver
- Implements
Constructors
HouseholdIdentifierResolver(IOptionsSnapshot<StateHouseholdIdSettings>, IUserRepository, IPhoneOverrideProvider, ILogger<HouseholdIdentifierResolver>?)
public HouseholdIdentifierResolver(IOptionsSnapshot<StateHouseholdIdSettings> settingsSnapshot, IUserRepository userRepository, IPhoneOverrideProvider phoneOverrideProvider, ILogger<HouseholdIdentifierResolver>? logger = null)
Parameters
settingsSnapshotIOptionsSnapshot<StateHouseholdIdSettings>userRepositoryIUserRepositoryphoneOverrideProviderIPhoneOverrideProviderloggerILogger<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
principalClaimsPrincipalcancellationTokenCancellationTokenOptional cancellation token.
Returns
- Task<HouseholdIdentifier>
The first preferred household identifier that can be resolved from the user's claims, or
nullif none is available.