# Authentication

> Manage your app's users, sign-in methods, multi-factor, passkeys and sessions.

Source: https://daster.io/docs/auth-storage-realtime/authentication/ · Last updated: 2026-11-21

Open **Authentication** in your project. It shows your app's own end users and settings. It needs Backend Cloud.

## Users

The **Users** tab lists your users with figures (users, signed in during the last 7 days, using MFA, blocked) and recent security events. Open a user to:

- **Save claims** (the app role and JSON claims; this signs the user out),
- **Sign out all sessions** or revoke one session,
- **Reset MFA**,
- **Block** or **Unblock**.

## Sign-in methods

On **Sign-in methods**, turn on what your app offers:

- **Email + password**, **Magic link**, **Email and phone codes**. DASTER cannot send the SMS for phone codes yet (`app_sms_unavailable`, 503). To use phone codes now, set the **Send SMS** [auth hook](https://daster.io/docs/auth-storage-realtime/authentication/#auth-hooks-beta) and send the code with your own SMS provider.
- **Google** and **GitHub**: enter your OAuth client details; the secret is never shown again.
- **Company sign-in** (OpenID Connect): create, turn on or off, delete.
- **SAML 2.0**: save a connection, download DASTER's metadata and upload it to your identity provider. DASTER checks each answer's signature against the certificate you saved, and its issuer, audience, ACS URL, request and time window. The identity provider must sign the assertion and send the email as the NameID (email format) or as an email attribute.

**Allow new users to sign up** turns sign-ups on or off. **Confirm email** is always on.

## Security settings

- **Policies**: the project's sign-in policy.
- **Multi-factor**: authenticator apps, and **require MFA**.
- **Passkeys**: turn on or off, set the relying party ID, and see **Registered passkeys** with **Remove**.
- **Sessions**: who is signed in, **Revoke**, **Sign everyone out**.
- **URL configuration**: the allowed callback origins.
- **Audit logs**: the newest 100 security events, with a CSV download.

**Usage & price** shows this month's measured monthly active users. Prices there are proposals.

## Rate limits

**Rate limits** sets how often each of these can happen in 15 minutes before a request is refused with `rate_limited` (HTTP 429):

| Limit                         | Counts per                                                      | Default | Highest |
| ----------------------------- | --------------------------------------------------------------- | ------- | ------- |
| Emails per address            | email address (sign-up, password reset, magic link, email code) | 5       | 50      |
| Phone codes per number        | phone number                                                    | 5       | 50      |
| Code and link tries           | magic link, email address or phone number                       | 10      | 100     |
| Password sign-ins per address | email address                                                   | 10      | 100     |

Leave a limit empty to use the default. Token refreshes have no per-project limit: each refresh token works once.

## Attack protection

- **Minimum password length**: 8 to 64 characters (default 15), for sign-up and password reset. Existing passwords keep working.
- **Block leaked passwords**: new passwords found in known data leaks are refused with `password_breached`. DASTER uses the HaveIBeenPwned range API: only the first 5 characters of the password's SHA-1 hash are sent. If that service cannot be reached, the password is allowed and the Audit log records it.
- **CAPTCHA** with Cloudflare Turnstile: enter your site key and secret key (the secret is stored encrypted; the page only shows that it is set and its last 4 characters). While it is on, sign-up, password sign-in and password-reset requests must carry the widget's token, or they are refused (`captcha_required`, `captcha_failed`).

## Emails

Set the **sender name** and edit the three emails: **Confirm sign-up**, **Magic link and email code** and **Reset password**. Templates are plain text with these placeholders:

- `{{link}}`: the link the person opens,
- `{{code}}`: the one-time code (email codes),
- `{{project}}`: your sender name,
- `{{email}}`: the person's email address.

Confirm sign-up and Reset password need `{{link}}`; Magic link and email code needs both `{{link}}` and `{{code}}`, because a magic-link email fills the link and an email-code email fills the code. Everything is HTML-escaped when the email is made. The preview shows the email exactly as it will be made.

The link opens your app's first allowed callback origin at `/auth/callback?type=signup|recovery|magic_link&token=…`; your app sends the token to `…/auth/verify`, `…/auth/reset` or `…/auth/magic-link/verify`.

These emails are sent through [App email](https://daster.io/docs/messaging/app-email/) from `no-reply@` your project's verified sender domain. Turn on App email and verify a domain first: until then, sign-up and sign-in emails are refused with `app_mail_unavailable` (503). Your own SMTP server for these emails is not available yet.

## Auth hooks (Beta)

**Auth hooks** run your own code at five moments of sign-in. Each is off until an organization owner or admin sets it to an `https://` address or a function in your project:

| Hook                          | DASTER sends                                                                 | Your answer                                               |
| ----------------------------- | ---------------------------------------------------------------------------- | --------------------------------------------------------- |
| Customize access token        | `user_id`, `authentication_method`, `aal`, `claims`                          | `{ "claims": { … } }` with your extra claims              |
| Send email                    | `user` (`id`, `email`) and `email` (`type`, `link` or `code`, `redirect_to`) | any 2xx once you sent it                                  |
| Send SMS                      | `user` (`id`, `phone`) and `sms.otp`                                         | any 2xx once you sent it                                  |
| MFA verification attempt      | `user_id`, `factor`, `valid`                                                 | `{ "decision": "continue" }` or `"reject"` with `message` |
| Password verification attempt | `user_id`, `method`, `valid`                                                 | `{ "decision": "continue" }` or `"reject"` with `message` |

Each call is a JSON `POST` signed with [Standard Webhooks](https://www.standardwebhooks.com) headers (`webhook-id`, `webhook-timestamp`, `webhook-signature`); check it with the signing secret, which is shown once when you save the hook (**Rotate secret** makes a new one). Answer within 5 seconds with at most 64 KB of JSON, without redirects. **Test** sends a sample call (`"test": true`).

If a hook fails, is too slow or answers wrongly, that sign-in step is refused (`auth_hook_failed`): DASTER never lets it through or sends the email itself. A reject is refused with `auth_hook_rejected` and your message (up to 200 characters). The token hook cannot change DASTER's own claims (`sub`, `role`, `aal`, `amr`, `exp` and the others).

## OAuth server (Beta)

The **OAuth server** makes your project an identity provider: other apps can offer "Sign in with" your app, and your users sign in with the account they already have. An organization owner or admin turns it on under **OAuth server** and registers each app under **OAuth apps**:

- **Server app (confidential)**: gets a client secret, shown once (**Rotate client secret** makes a new one).
- **Browser or mobile app (public)**: no secret; it proves itself with PKCE.
- **Redirect addresses** are matched exactly, written in full, without `*` or `#`: `https://…`, or `http://localhost`, `127.0.0.1` or `[::1]` for an app you run on your own machine while you develop it.
- **Scopes**: `openid`, `email`, `profile`, and `offline_access` for refresh tokens.

Apps use the authorization code flow with PKCE (`S256`) and find everything in the discovery document at `{issuer}/.well-known/openid-configuration`. Your users sign in on a DASTER-hosted page and approve the app once (remembered 30 days). ID and access tokens are RS256 JWTs (5 minutes) that any OpenID Connect library verifies with `{issuer}/jwks`; refresh tokens rotate on every use, and a reused one ends the whole sign-in. Your **Customize access token** hook also runs on these access tokens. People can see and remove the apps they allowed with `GET` and `DELETE` on `…/auth/oauth-apps`.

The issuer is `https://app.daster.io/backend/v1/projects/{projectId}/oauth`. Dynamic client registration is not available yet.

## Performance

**Performance** lists suggestions computed from your live settings and sign-ins: a minimum length below 12, a rate limit raised far above its default, the leaked-password check or CAPTCHA off, and sign-in methods that are on but unused for 30 days. Sign-in speed is not measured yet.

> **Note:** Not available yet: adding, inviting, emailing or deleting users from the Dashboard; anonymous sign-in; session lifetime rules; phone MFA; Apple, Microsoft and other providers.

> **Note:** Google and GitHub sign-in for your app's users use your own OAuth client details. They have not yet been tested by DASTER against the live providers.

## Sign up and sign in from your app

Requests go to your project's data API, `DASTER_URL`, with the browser key in the `apikey` header:

```http
POST /backend/v1/projects/{projectId}/auth/signup
apikey: daster_pk_dev_…
Content-Type: application/json

{ "email": "user@example.com" }
```

The user gets a verification email; `POST …/auth/verify` with `{ "token", "password" }` completes it. With CAPTCHA on, add `"captchaToken": "<token from the Turnstile widget>"` to the sign-up, sign-in and `reset-request` bodies. Then:

```http
POST /backend/v1/projects/{projectId}/auth/signin
apikey: daster_pk_dev_…
Content-Type: application/json

{ "email": "user@example.com", "password": "…" }
```

Send the returned access token as `Authorization: Bearer <token>` on later requests. Other routes under `…/auth/`: `refresh`, `signout`, `user`, `magic-link/…`, `otp/email/…`, `otp/phone/…`, `oauth/…`, `mfa/…`, `passkeys/…` and `sessions`.

Your policies can read the verified claims (`sub`, `role`, `aal`, `amr`) through `auth.jwt()`.
