Configuration
The Configuration object is validated against a Zod schema at startup. Passing invalid values throws immediately with a descriptive error. All fields are required unless marked optional.
Pass the configuration object to configuration(...) exactly once when your H3, Nitro, or Nuxt application starts. You can spread one of the shipped templates and override only the fields you need. See Getting Started for setup examples.
server
Connection and security settings for the upstream IAM service.
server.auth_location
server.hmac
HMAC request signing. A discriminated union on enableHmac.
true, every outbound request to the IAM service is signed with HMAC-SHA256. When false, requests are sent without authentication headers. The clientId and sharedSecret fields are required when enableHmac is true.X-Client-Id. Required when enableHmac is true. Must match the value registered on the IAM service.enableHmac is true. Must be identical in both the module configuration and the IAM service configuration. Should be at least 32 bytes of random data.server.ssl
Mutual TLS configuration. A discriminated union on enableSSL.
true, all outbound connections use the configured certificate bundle. When false, plain HTTP is used.enableSSL is true.mainDirPath. Required when enableSSL is true.mainDirPath. Required when enableSSL is true.mainDirPath. Required when enableSSL is true.server.cryptoCookiesSecret
htmlSanitizer
Controls the multi-pass HTML sanitization pipeline used by sanitizeInputString and makeSafeString.
50.50000.imageUploader
Controls the image validation and conversion pipeline used by validateImage.
5000000 (5 MB).validateImage. Validated against the actual detected type from the file magic bytes. Default to ["image/png", "image/jpeg", "image/webp"].validateImage. Validated against the extension detected from magic bytes. Default to ["png", "webp", "jpeg", "jpg"]..webp extension to form the final storage key. When omitted, a UUID is used as the prefix.uStorage
Unstorage configuration for session caching. The storage instance is used by getCachedUserData to cache IAM responses.
Storage instance. The module validates that getItem and setItem are present. Any unstorage driver works: memory, Redis, filesystem, Cloudflare KV, and so on.getCachedUserData. Default to 2592000 (30 days). Increasing this reduces load on the IAM service but delays detection of revoked sessions.10 seconds.onSuccessRedirect
OAuthProviders
An optional array of OAuth and OIDC provider configurations. See OAuth and OIDC for the full field reference for each provider kind.
OAuthProviders: [
{
kind: 'oidc',
name: 'google',
issuer: 'https://accounts.google.com',
// ...
},
{
kind: 'oauth',
name: 'github',
authorizationEndpoint: 'https://github.com/login/oauth/authorize',
// ...
}
]
magicLinkRedirectPath
useMagicLink to complete the flow. Default to '/auth/verify'.magicLinkBouncePath
bounceRouter for handling incoming magic links. The IAM service generates links that land here first. The bounce handler parses the parameters and redirects to magicLinkRedirectPath. Default to '/auth/bounce'.enableFireWallBans
true, botDetectorMiddleware and restartPasswordHandler call banIp to add a UFW firewall rule for flagged IPs. Requires a Linux environment with ufw installed and passwordless sudo for the Node.js process. Set to false on serverless or edge environments.logLevel
info in production. Use debug in development to see the full authentication pipeline output.