Skip to content

Email & Password

import { Aside } from ‘@astrojs/starlight/components’;

Email and password authentication is the baseline login method in every Kotauth workspace. Users submit credentials to Kotauth’s hosted login page — your application never receives or handles passwords directly.

  1. Your application redirects the user to /t/{slug}/authorize to begin an OAuth2 Authorization Code flow. Kotauth renders the hosted login page.
  2. The user enters their username or email and password.
  3. Kotauth verifies the credentials, enforces MFA if required, and issues an authorization code.
  4. The code is exchanged for access and refresh tokens at the token endpoint.

Passwords are hashed with bcrypt at cost factor 10. Raw passwords are never stored or logged.

Each workspace defines its own password policy, configurable in the admin console under Settings → Security:

Policy settingDescription
Minimum lengthDefault: 8 characters
Require uppercaseAt least one A–Z character
Require lowercaseAt least one a–z character
Require numbersAt least one 0–9 digit
Require symbolsAt least one non-alphanumeric character
Maximum age (days)Force password change after N days. 0 = no expiry
History depthPrevent reuse of last N passwords. 0 = no history
BlacklistReject specific passwords (e.g. common passwords)

Kotauth can automatically lock accounts after repeated failed login attempts, protecting against brute-force attacks. Account lockout is disabled by default and configured per workspace in the admin console under Settings → Security.

SettingDefaultDescription
Max failed attempts0 (disabled)Number of consecutive failed logins before the account is locked. Set to 0 to disable lockout entirely.
Lockout duration (minutes)15How long the account remains locked before automatic unlock.

When an account is locked:

  • All login attempts are rejected with an “account locked” message, regardless of whether the password is correct.
  • If SMTP is configured, the user receives an email notification with the lockout duration and a password reset link.
  • An ACCOUNT_LOCKED audit event is recorded.
  • Admins can manually unlock accounts from the user detail page in the admin console. This records an ACCOUNT_UNLOCKED audit event.
  • The failed attempt counter resets on a successful login.

Login attempts are rate-limited at 5 attempts per minute per IP address per workspace. After exceeding the limit, further attempts return 429 Too Many Requests until the window resets.

Users can request a password reset from the login page. Kotauth sends an email with a time-limited reset link (default: 1 hour). On clicking the link, the user sets a new password and all existing sessions are revoked. A password changed notification email is sent to the user.

Password reset requests are rate-limited at 3 attempts per 5-minute window per IP to prevent abuse of the email delivery pipeline.

Password reset requires SMTP to be configured in the workspace settings.

On registration, Kotauth sends a verification email with a 24-hour token. Unverified accounts can still log in unless the workspace policy requires verification first. Verification status is available as the email_verified claim in access tokens.

Kotauth sends security notification emails when significant account events occur (requires SMTP to be configured):

EventEmail sentContent
Password changed (any path)YesInformational notification. No action links to prevent phishing surface.
Account lockedYesIncludes lockout duration and a password reset link.
Password reset completedYesConfirmation that the password was changed via reset link.

All notification emails are sent asynchronously — they do not block the authentication flow.

As of v1.3.1, all password input fields (registration, password change, password reset) display a real-time validation checklist that reflects the workspace’s configured password policy. Each requirement (minimum length, uppercase, lowercase, digits, symbols) updates inline as the user types — invalid rules show a dimmed indicator that transitions to a green checkmark when satisfied. The submit button is not enabled until all rules pass.

This validation is purely cosmetic — the server enforces the same rules on submission regardless of client-side state. The checklist is rendered from the workspace’s PasswordPolicy configuration, so it adapts automatically when an admin changes the policy.

Authenticated users can change their own password at /t/{slug}/account/password without admin involvement. The current password is required to set a new one. When the password is changed, all existing sessions are revoked and a security notification email is sent.