Configuration Reference

June 29, 2026 · View on GitHub

All configurable options across the AAuth .NET SDK, grouped by component.

Signature Verification

AAuthVerifier

PropertyTypeDefaultDescription
MaxAgeTimeSpan60 secondsMaximum signature age before rejection
MaxFutureSkewTimeSpan5 secondsClock skew tolerance into the future
ClockFunc<DateTimeOffset>UtcNowClock source (override for testing)

AAuthServerOptions (via UseAAuth)

The single UseAAuth pipeline middleware. Defaults to the DI-registered resource metadata (issuer + first signing key); a typical resource sets only trust.

PropertyTypeDefaultDescription
TrustedAuthTokenIssuersIReadOnlySet<string>?nullAllow-list of trusted auth token (PS/AS) issuers. null ⇒ accept any verifiable auth-token issuer (the spec default — the JWT signature still verifies against the issuer's JWKS); empty ⇒ deny all; non-empty ⇒ restrict to the listed issuers. AND-composed with IsTrustedAuthTokenIssuer.
IsTrustedAuthTokenIssuerFunc<string, bool>?nullOptional predicate AND-composed with TrustedAuthTokenIssuers (each only narrows). Assign AAuthTrust.Any to trust any verifiable issuer explicitly and suppress the open-trust startup warning.
PersonServerAudiencestring?nullResource-token audience for the challenge. Set to an Access Server URL for four-party (federated) resources; when null the audience is the agent token's ps claim (three-party).
RequireIssuerVerificationbooltrueVerify the auth-token issuer's JWKS signature.
TrustedAgentProviderIssuersIReadOnlySet<string>?nullAllow-list of trusted Agent Provider issuers (for aa-agent+jwt). null ⇒ accept any verifiable Agent Provider; empty ⇒ deny all; non-empty ⇒ restrict. AND-composed with IsTrustedAgentProviderIssuer.
IsTrustedAgentProviderIssuerFunc<string, bool>?nullOptional predicate AND-composed with TrustedAgentProviderIssuers. Assign AAuthTrust.Any to trust any verifiable Agent Provider explicitly.
ResourceIdentifierstring?DI metadata issuerOverride the resource identifier used for aud checks and challenges.
ResourceSigningKeyAAuthKey?DI metadata first keyOverride the challenge signing key.
ResourceKeyIdstring?DI metadata first kidOverride the challenge key id.

AAuthVerificationOptions and ChallengeOptions are the low-level building blocks UseAAuth configures from each endpoint's .RequireAAuth(...) / .RequireAAuthSignature(...) requirement; use them directly only for custom pipelines.

AAuthVerificationOptions (via UseAAuthVerification)

PropertyTypeDefaultDescription
ResourceIdentifierstring?nullResource's own identifier for aud checks. When null, audience validation is skipped.
RequireIssuerVerificationbooltrueWhen true, verifies JWT signatures against the issuer's published JWKS via metadata discovery. The crypto gate is orthogonal to the trust lists below — they only narrow which verified issuers are honored.
TrustedAgentProviderIssuersIReadOnlySet<string>?nullOptional allow-list of trusted AP issuers. null ⇒ any verifiable AP; empty ⇒ deny all; non-empty ⇒ restrict. AND-composed with IsTrustedAgentProviderIssuer.
IsTrustedAgentProviderIssuerFunc<string, bool>?nullOptional predicate AND-composed with TrustedAgentProviderIssuers; assign AAuthTrust.Any for explicit open trust.
TrustedAuthTokenIssuersIReadOnlySet<string>?nullAllow-list of trusted auth token (PS/AS) issuers. null ⇒ accept any verifiable PS (the spec default); empty ⇒ deny all PS-asserted tokens; non-empty ⇒ restrict to the listed issuers. AND-composed with IsTrustedAuthTokenIssuer.
IsTrustedAuthTokenIssuerFunc<string, bool>?nullOptional predicate AND-composed with TrustedAuthTokenIssuers (each only narrows). Assign AAuthTrust.Any to trust any verifiable issuer explicitly and suppress the open-trust startup warning.
MaxActDepthint10Maximum delegation chain depth for nested act claims
ClockSkewTimeSpan30 secondsTolerance applied to exp/iat checks
MaxFutureSkewTimeSpan5 secondsMaximum allowed skew into the future for HTTP signature timestamps
ClockFunc<DateTimeOffset>?null (UtcNow)Clock source for all time-dependent checks. Inject for deterministic testing.

Two startup guards (diagnostics only — neither changes runtime behavior):

  • Open-trust warning — when issuer verification is on and no auth-token trust policy is configured (no set, no predicate, no AAuthTrust.Any), the resource accepts any verifiable Person Server and a Warning is logged at startup. The same warning fires for an open PS (no TrustedAccessServers / IsTrustedAccessServer) or open AS (no TrustedPersonServers / IsTrustedPersonServer); any explicit policy suppresses it.
    • False positive on signature-only resources: a UseAAuth resource whose endpoints are all RequireAAuthSignature (no auth-token endpoints) still logs this warning — the SDK can't know at startup that no auth-token endpoint exists. It is benign; silence it by assigning IsTrustedAuthTokenIssuer = AAuthTrust.Any.
  • Contradiction throw — configuring a trust policy (TrustedAuthTokenIssuers / IsTrustedAuthTokenIssuer / TrustedAgentProviderIssuers / IsTrustedAgentProviderIssuer) while RequireIssuerVerification == false throws InvalidOperationException at UseAAuth / UseAAuthVerification construction, because the policy would otherwise be silently ignored.

AAuthResourceOptions (via AddAAuthResource)

PropertyTypeDefaultDescription
Issuerstring— (required)HTTPS issuer URL for this resource
SigningKeysDictionary<string, AAuthKey>{}Key-id → signing key map
Namestring?nullHuman-readable resource name (name)
ScopeDescriptionsDictionary<string, string>?nullScope → description map for metadata
SignatureWindowint?nullAdvertised signature validity (seconds)
AuthorizationEndpointstring?nullAS authorization URL
RevocationEndpointstring?nullRevocation endpoint URL

AAuthPersonServerOptions (via MapAAuthPersonServer)

PropertyTypeDefaultDescription
Issuerstring— (required)HTTPS URL of this PS (iss of minted auth tokens)
SigningKeysIReadOnlyDictionary<string, AAuthKey>— (required)Key-id → signing key map (published at the PS JWKS)
TokenPathstring/tokenToken endpoint path
PendingPathPrefixstring/pendingDeferred-consent poll path prefix
DefaultScopestring""Scope assumed when the resource token omits one
InteractionPathstring/interactionPath the host maps for the consent page
TrustedAccessServersIReadOnlyCollection<string>?nullAS URLs the PS will federate to. null ⇒ federate to the AS named in a verified resource token's aud (the spec default); empty ⇒ three-party only (four-party disabled); non-empty ⇒ restrict to the listed Access Servers. AND-composed with IsTrustedAccessServer.
IsTrustedAccessServerFunc<string, bool>?nullOptional predicate AND-composed with TrustedAccessServers; assign AAuthTrust.Any to federate to any verifiable AS explicitly.

The helper resolves IIdentityClaimsAsserter and IPersonPendingStore from DI (and the IMissionStore / IMissionLog mission primitives when a request carries a mission claim). See Token Issuance → One-Call Person Server.

Token Builders

ResourceTokenBuilder

PropertyTypeDefaultDescription
LifetimeTimeSpan5 minutesToken validity duration
IssuedAtDateTimeOffset?NowOverride issuance timestamp
TokenIdstring?Auto (UUID)Custom jti value

AuthTokenBuilder

PropertyTypeDefaultDescription
LifetimeTimeSpan1 hourToken validity duration
Dwkstring"aauth-person.json"Discovery well-known path
IssuedAtDateTimeOffset?NowOverride issuance timestamp
TokenIdstring?Auto (UUID)Custom jti value

AgentTokenBuilder

PropertyTypeDefaultDescription
LifetimeTimeSpan1 hourToken validity duration
IssuedAtDateTimeOffset?NowOverride issuance timestamp
TokenIdstring?Auto (UUID)Custom jti value

Token Verification

TokenVerifier

PropertyTypeDefaultDescription
ClockFunc<DateTimeOffset>UtcNowClock source
ClockSkewTimeSpan30 secondsTolerance for exp/iat validation
MaxActDepthint10Maximum delegation chain depth

DeferredPollerOptions

PropertyTypeDefaultDescription
MaxTotalWaitTimeSpan5 minutesMaximum time to poll before timeout
DefaultPollIntervalTimeSpan5 secondsBase interval between polls
MinPollIntervalTimeSpan100msMinimum interval floor
PreferWaitSecondsint?nullSend Prefer: wait=N header (long-poll)
OnPollAction<HttpResponseMessage>?nullCallback after each poll response

Server Retry-After headers override DefaultPollInterval (clamped to MinPollInterval).

ChallengeHandlingOptions

PropertyTypeDefaultDescription
OnInteractionRequiredFunc<Interaction, CancellationToken, Task>?nullCallback for 202+interaction
PollingTimeoutTimeSpan5 minutesMaximum polling time
DefaultPollIntervalTimeSpan5 secondsInterval between polls
PreferWaitSecondsint?nullPrefer: wait=N header value
MinPollIntervalTimeSpan100msMinimum poll interval floor
OnPollAction<HttpResponseMessage>?nullCallback after each poll

InteractionHandlingOptions

PropertyTypeDefaultDescription
OnInteractionRequiredFunc<string, string, CancellationToken, Task>?nullCallback for 202+interaction (URL, code)
OnApprovalPendingFunc<CancellationToken, Task>?nullCallback for 202+approval
PollingTimeoutTimeSpan5 minutesMaximum polling time
DefaultPollIntervalTimeSpan5 secondsInterval between polls
PreferWaitSecondsint?nullPrefer: wait=N header value
MinPollIntervalTimeSpan100msMinimum poll interval floor
OnPollAction<HttpResponseMessage>?nullCallback after each poll

Discovery

MetadataClient

ParameterTypeDefaultDescription
httpHttpClient— (required)HTTP client for fetching documents
cacheTtlTimeSpan?null (no expiry)Cache entry lifetime
clockFunc<DateTimeOffset>?UtcNowClock source for cache expiration

Methods:

  • BuildUrl(issuer, dwk) — constructs .well-known/{dwk} URL from issuer
  • FetchAsync(url) — fetches and caches the JSON document
  • Invalidate(url) — evicts a cached entry

Resource Metadata

AAuthResourceMetadataOptions

PropertyTypeRequiredDescription
IssuerstringYesResource canonical URL
SigningKeysIReadOnlyDictionary<string, AAuthKey>YesKey-id → signing key map
Namestring?NoHuman-readable resource name (name)
ScopeDescriptionsIReadOnlyDictionary<string, string>?NoScope → description
SignatureWindowint?NoAdvertised signature validity (seconds)
AuthorizationEndpointstring?NoAS authorization URL
RevocationEndpointstring?NoRevocation endpoint URL

Key Storage

FileKeyStore (File-Based)

Property/MethodDescription
DirectoryStorage directory path
Default()Creates store at ~/.aauth/keys/
LoadOrCreate(name)Load key or generate new Ed25519 key

DefaultSignatureKeyResolver

ParameterTypeDefaultDescription
jwksClientJwksClient?nullClient for fetching JWKS endpoints

Signing (Agent-Side)

AAuthSigningHandler

Standard DelegatingHandler — no configurable options. Requires an ISignatureKeyProvider to supply the signing key and Signature-Key header value.

ISignatureKeyProvider Implementations

ProviderConstructor Parameters
HwkSignatureKeyProviderIAAuthKey key
JwksUriSignatureKeyProviderstring uri, string kid
JwtSignatureKeyProviderFunc<string> tokenFactory
JktJwtSignatureKeyProviderIAAuthKey ephemeralKey, Func<string> namingJwtFactory

Dependency Injection Options

AAuthAgentOptions (AddAAuthAgent)

PropertyTypeRequiredDescription
KeyIAAuthKeyYesAgent signing key (must have private component)
PersonServerstring?NoPerson Server URL; with TokenRefresher, enables 401 challenge handling
OnInteractionRequiredFunc<Interaction, CancellationToken, Task>?NoPS interaction during token exchange (deferred consent)
OnResourceInteractionFunc<string, string, CancellationToken, Task>?NoResource 202 + requirement=interaction (URL + code)
OnApprovalPendingFunc<CancellationToken, Task>?NoResource 202 + requirement=approval
TokenRefresherITokenRefresher?NoAuto-refresh before token expiry (JWT identity); omit for HWK
PollingTimeoutTimeSpanNoMax deferred polling time (default 5 minutes)

AAuthResourceOptions (AddAAuthResource)

PropertyTypeRequiredDescription
IssuerstringYesResource canonical URL
SigningKeysDictionary<string, AAuthKey>YesKey-id → signing key map
Namestring?NoResource display name (name)
ScopeDescriptionsDictionary<string, string>?NoScope descriptions for metadata
SignatureWindowint?NoAdvertised signature validity (seconds)
AuthorizationEndpointstring?NoAS authorization URL
RevocationEndpointstring?NoRevocation endpoint URL

AAuthDiscoveryOptions (AddAAuthDiscovery)

PropertyTypeDefaultDescription
MetadataCacheTtlTimeSpan5 minutesMetadata document cache lifetime
JwksCacheTtlTimeSpan1 hourJWKS cache lifetime
JwksMinRefreshIntervalTimeSpan1 minuteMinimum interval between JWKS fetches (rate limit)

ChallengeHandlingOptions (WithChallengeHandling)

PropertyTypeDefaultDescription
OnInteractionRequiredFunc<Interaction, CancellationToken, Task>?nullDeferred consent callback
PollingTimeoutTimeSpan5 minutesMax deferred polling time
DefaultPollIntervalTimeSpan5 secondsPoll interval (overridden by Retry-After)
PreferWaitSecondsint?nullSends Prefer: wait=N to long-poll
MinPollIntervalTimeSpan100 msMinimum delay between polls
OnPollAction<HttpResponseMessage>?nullPer-poll callback (logging/progress)
CapabilitiesIList<string>?nullCapabilities sent to the PS (null = infer)
Promptstring?nullOIDC prompt sent to the PS
AdditionalSignatureComponentsIReadOnlyDictionary<string, IReadOnlyList<string>>?nullPer-origin extra covered components to seed

InteractionHandlingOptions (WithInteractionHandling)

PropertyTypeDefaultDescription
OnInteractionRequiredFunc<string, string, CancellationToken, Task>?nullInteraction URL + code callback
OnApprovalPendingFunc<CancellationToken, Task>?nullApproval polling callback
PollingTimeoutTimeSpan5 minutesMax polling time

JSON Configuration Keys (samples)

The shipped samples bind a few AAuth:* keys from appsettings.json / environment variables / command line. These are conventions of the samples (not SDK-required), shown here as a reference for wiring your own hosts.

KeyTypeUsed byDescription
AAuth:IssuerstringProfile/Calendar/Trips/Wallet/Inbox, MockPersonServer, ConciergeThe host's own canonical URL (resource/PS iss).
AAuth:SignatureWindowint (seconds)Profile/Calendar/Trips/Wallet/Inbox, MockPersonServerMax HTTP-signature age accepted; default 60.
AAuth:TrustedPersonServersstring[]Calendar/TripsAllow-list mapped to the resource pipeline's TrustedAuthTokenIssuers (app.UseAAuth(o => o.TrustedAuthTokenIssuers = …)). The SDK default for an unset list is open (accept any verifiable PS, namespaced by iss), but these samples default to http://localhost:5100; an empty array denies all auth tokens (deny-all kill-switch).
AAuth:LocalKeyHandlestringagent samplesKey handle in the IKeyStore for the agent's signing key.
AAuth:ApRefreshEndpointstringagent samplesAgent Provider refresh endpoint for enrolled agents.
AAuth:PersonServerstringConciergeDownstream Person Server URL.
AAuth:DownstreamstringConciergeDownstream resource URL.
AAuth:AgentIdstringConciergeThe agent identifier this host signs as.
AAuth:SelfIssuer / AAuth:SelfAgentIdstringSampleAppSelf-issued agent issuer / identifier.

Further Reading