Identity & access

Sign-up and password sign-in

Gives an application accounts and password sign-in without a separate identity service.

Available in previewEngine edition 5f8ea3af

What it does

Email-and-password accounts with bcrypt-hashed passwords and signed access tokens. Each project has its own pool of end users, its own signing secret and its own tokens, reached with the project anon key under /auth/v1. Operator accounts are a separate surface and have their own page.

How it works

A sign-up request carries an email address and a password of at least eight characters. The address is trimmed and lower-cased, must contain an at-sign, and must not already exist in the pool. The password is hashed with bcrypt at the library default cost of 12 before anything is stored, and the plain password is never written. Sign-in compares the submitted password with the stored hash and, on a match, returns an access token, a refresh token, the token type, the lifetime in seconds and the public view of the user.

Access tokens are HS256 JSON Web Tokens. A project signs its end-user tokens with its own 64-byte secret and stamps its project id into each token, so a token minted in one project is rejected by every other. The access lifetime defaults to one hour and the refresh lifetime to 30 days; both can be changed with KYNETRA_ACCESS_TTL_SECS and KYNETRA_REFRESH_TTL_SECS.

The credential on a request selects the pool. A project anon key or service key, sent in the apikey header or as a bearer token, selects that project. A request with no project credential is handled by the platform pool instead. A project whose lifecycle state blocks authentication is refused outright rather than falling back to the platform pool. In a paused project existing sessions can still renew, but new sign-ins and sign-ups are refused.

Roles in a pool are admin, editor and viewer. Password sign-up gives the editor role, except for the first account in an empty pool, which becomes admin. Those roles feed the collection rules and row-level policies of the project, which are described on their own pages.

Where you reach it

  • HTTPPOST /auth/v1/signup
  • HTTPPOST /auth/v1/token?grant_type=password
  • HTTPGET /auth/v1/user
  • HTTPPOST /auth/v1/logout
  • ConfigKYNETRA_ACCESS_TTL_SECS, KYNETRA_REFRESH_TTL_SECS

Example

Create an end user, then sign inbash
# Sign up in a project (send the project anon key)
curl -s -X POST "$KYNETRA_URL/auth/v1/signup" \
  -H "apikey: $PROJECT_ANON_KEY" \
  -H "Content-Type: application/json" \
  -d '{"email":"ada@example.com","password":"a-long-passphrase","display_name":"Ada"}'

# Sign in later: returns access_token, refresh_token, token_type, expires_in and user
curl -s -X POST "$KYNETRA_URL/auth/v1/token?grant_type=password" \
  -H "apikey: $PROJECT_ANON_KEY" \
  -H "Content-Type: application/json" \
  -d '{"email":"ada@example.com","password":"a-long-passphrase"}'

Limits

  • The first account in a new project pool becomes its admin, and a pool admin can change that project's collection definitions and rules. Create the first account yourself, with the service key, before the anon key is public.
  • No setting closes project sign-up, which is a normal application feature. If sign-up must be restricted, limit who can reach the project sign-up routes at your own network or proxy layer. Keep operator endpoints, including platform account creation, reachable only by operators.
  • Passwords need at least eight characters. There is no strength check, no breached-password check and no account lockout; repeated attempts are limited by the per-address request budget described under request protection.
  • Access tokens are stateless. Signing out revokes refresh tokens, and an access token that was already issued stays valid until it expires.
  • Sign-up does not require a verified address. Verification is recorded when a one-time code or link is redeemed.
  • Multi-factor authentication is not offered for project end users. It covers operator accounts alone.
  • No sign-in throughput figure is published for this edition.

Evidence

Test coverage is listed as present in the engine repository at this edition. This page does not report test results.

KynetraDB is in private preview

Request a preview to try this against your own workload.