-
Notifications
You must be signed in to change notification settings - Fork 0
Configuration
SharpAccess configuration is host-owned. Production secrets must come from a protected secret manager or equivalent OS-level injection, not tracked JSON.
Configure:
-
BaseUrias the externally visible origin. -
JwtIssuerandJwtAudience. -
AccessTokenSigning.ActiveKeyIdplus the active and retained verification keys. -
TokenHashing.CurrentKeyVersionplus accepted token-hashing keys. -
Passwords.CurrentPepperVersionplus accepted pepper versions. -
RateLimits.PartitionKeywhenever a mapped rate-limited feature is enabled. -
Featuresfor password authentication, registration, reset, refresh, administration, tenancy, and enabled OIDC providers.
Use independent random values for every secret role. Production validation rejects weak, predictable, undersized, or reused material.
The host supplies the selected provider connection through supported provider configuration or a host-managed connection factory.
A common configuration shape is:
{
"ConnectionStrings": {
"Auth": "<host-owned DB connection string>"
}
}Register exactly one provider:
builder.Services.AddSqliteAccess(builder.Configuration);
// or
builder.Services.AddPostgresAccess(builder.Configuration);Outside local development:
- keep the refresh cookie secure;
- use a
__Secure-prefixed cookie name for non-loopback production hosts; - require the request-confirmation header for cookie-backed refresh and logout;
- do not return refresh tokens in response bodies for browser applications;
- keep access tokens out of local storage and session storage.
The documented request-confirmation defaults are:
APP_REQUIRE_COOKIE_CONFIRMATION_HEADER=true
APP_COOKIE_CONFIRMATION_HEADER_NAME=X-SharpAccess-CSRF
APP_COOKIE_CONFIRMATION_HEADER_VALUE=1
Persist Data Protection keys outside ephemeral storage and protect them at rest. Instances that must read the same OAuth state payloads, cookies, or opaque cursors must share the same application name and protected key ring.
Each enabled provider requires:
- exact issuer and callback configuration;
- authorization, token, and JWKS endpoints within explicit host allowlists;
- client ID and protected client secret;
- Authorization Code + PKCE;
- nonce and state validation.
See OIDC.
- HTTPS and trusted proxy configuration.
- Protected independent secrets.
- Durable Data Protection keys.
- Least-privilege database principal.
- Production email sender.
- Backups and tested restore.
- Observability for authentication, authorization, rate limits, replay, and account-state events.
SharpAccess · Windows · .NET 10 · PowerShell 7 · Repository · Security · License