Documentation menu

AuthKit-Prov1.0.0

AuthKit-Pro configuration

Configure AuthKit-Pro database, JWT, development utilities, passkeys, mail, magic links, OAuth2/OIDC, and maintenance.

Updated

Configuration model

AuthKit-Pro runs from safe local defaults in application.properties and optionally imports an ignored root .env file. Use standard Spring Boot properties for mail and OAuth2 clients; use the documented AuthKit variables for product policy.

Database

Database environment variables
VariableLocal defaultPurpose
DB_URLjdbc:h2:mem:authkit_pro;MODE=MySQL;DB_CLOSE_DELAY=-1JDBC connection URL
DB_USERNAMEsaDatabase user
DB_PASSWORDEmptyDatabase password

JWT

JWT environment variables
VariableDefaultPurpose
JWT_SECRETGenerated locallyHS256 signing secret; production requires a stable high-entropy value of at least 32 characters
JWT_ACCESS_TOKEN_TTL15mAccess-token lifetime
JWT_REFRESH_TOKEN_TTL14dAbsolute refresh-session lifetime
JWT_ISSUERauthkitRequired issuer
JWT_AUDIENCEauthkit-apiRequired audience

Development utilities

Development utility variables
VariableDefaultPurpose
AUTHKIT_DEMO_DATA_ENABLEDfalseSeed local demo users on an empty database
AUTHKIT_API_TEST_ENABLEDtrueServe /api-test and its assets

Passkeys

Passkey environment variables
VariableDefault
PASSKEY_ENABLEDfalse
PASSKEY_RP_NAMEBuildBaseKit AuthKit-Pro
PASSKEY_RP_IDlocalhost
PASSKEY_ALLOWED_ORIGINShttp://localhost:8080,http://localhost:3000

Account lifecycle and mail

Verification, reset, email-change, and magic-link messages append a credential fragment to the trusted action page. Configure an absolute HTTPS URL without credentials, query, or fragment for production.

Account lifecycle variables
VariableDefault / purpose
AUTHKIT_ACCOUNT_ACTION_URLhttp://localhost:8080/api-test/; complete trusted action page
AUTHKIT_FROM_EMAILno-reply@example.com
AUTHKIT_MAIL_REQUIREDfalse locally; true is required by the production policy
AUTHKIT_VERIFICATION_TTL24h
AUTHKIT_RESET_TTL30m
spring.mail.*Standard Spring Boot SMTP configuration

OAuth2 and OIDC

OAuth providers use standard spring.security.oauth2.client.* properties. Google and GitHub can use Spring Boot's common-provider defaults. A generic OIDC registration supplies its registration fields plus spring.security.oauth2.client.provider.<id>.issuer-uri for discovery.

.env example
spring.security.oauth2.client.registration.google.client-id=<client-id>
spring.security.oauth2.client.registration.google.client-secret=<client-secret>

spring.security.oauth2.client.registration.company.provider=company
spring.security.oauth2.client.registration.company.client-id=<client-id>
spring.security.oauth2.client.registration.company.client-secret=<client-secret>
spring.security.oauth2.client.registration.company.authorization-grant-type=authorization_code
spring.security.oauth2.client.registration.company.redirect-uri={baseUrl}/login/oauth2/code/{registrationId}
spring.security.oauth2.client.registration.company.scope=openid,profile,email
spring.security.oauth2.client.provider.company.issuer-uri=https://id.example.com

Maintenance

  • Expired account credentials are deleted.
  • Sessions are deleted seven days after absolute expiry, cascading stored refresh digests.
  • Security activity older than 90 days is deleted.
  • Spring One-Time Token performs its own hourly expiry cleanup.
Maintenance configuration
PropertyDefaultBehavior
authkit.maintenance.cron0 0 3 * * *Daily at 03:00 UTC; '-' disables the schedule

Production checklist

  • Use persistent MySQL-compatible storage, backups, and restricted credentials.
  • Provide a stable high-entropy JWT_SECRET.
  • Use HTTPS, exact CORS/WebAuthn origins, a correct RP ID, and secure session cookies.
  • Configure a trusted AUTHKIT_ACCOUNT_ACTION_URL and working Spring Mail transport.
  • Disable demo data and the browser API tester.
  • Apply gateway or reverse-proxy rate limits to authentication and recovery endpoints.
  • Restrict sensitive request, header, callback, and ORM bind logging.
  • Monitor database health and mail-delivery failures.