Sign-in and signup
Configure email verification codes, Google sign-in, signup scope, and instance access restrictions.
Multica signs users in with email verification codes by default; Google OAuth can be added on top. Signup restrictions only decide whether new accounts can be created — existing users can keep signing in unless you also configure an instance-wide access allowlist with ACCESS_ALLOWED_EMAILS.
Email verification codes
After the user enters an email address, Multica sends a 6-digit verification code (at most one code per 60 seconds per email; requesting a new code invalidates earlier unused ones). The code is valid for 10 minutes and allows up to 5 verification attempts; 10 consecutive failed attempts across codes lock verification for that email for 15 minutes. Codes are stored as HMAC-SHA256 digests bound to the email (MULTICA_VERIFICATION_CODE_SECRET, or derived from JWT_SECRET when unset). Once the code verifies, the browser receives a sign-in cookie.
Email can be delivered through Resend or SMTP. When both are configured, SMTP_HOST takes priority.
Using Resend
Verify a sending domain and create an API key at Resend.
Set:
RESEND_API_KEY=re_xxxxxxxxxxxxxxxx
RESEND_FROM_EMAIL=noreply@example.comRestart the API service.
RESEND_FROM_EMAIL must belong to a domain already verified in Resend.
Using SMTP
At minimum, set the host and sender address:
SMTP_HOST=smtp.example.com
SMTP_PORT=587
SMTP_USERNAME=multica
SMTP_PASSWORD=<password>
SMTP_FROM_EMAIL=noreply@example.comCommon connection modes:
| Scenario | Configuration |
|---|---|
| Internal anonymous relay | SMTP_PORT=25, leave username and password empty |
| STARTTLS | SMTP_PORT=587; upgrades to TLS by default when the server supports it |
| Implicit TLS | SMTP_PORT=465, or set SMTP_TLS=implicit explicitly |
If SMTP_FROM_EMAIL is unset, it falls back to RESEND_FROM_EMAIL. Private CAs or self-signed certificates require adding the CA to the container trust store; SMTP_TLS_INSECURE=true skips certificate verification and should only be used temporarily on a trusted internal network.
Some strict relays also require a valid EHLO name:
SMTP_EHLO_NAME=mail.example.comBehavior without an email service
The server still starts, but verification codes and invitation links are only written to the log; no email is sent. This mode is only suitable for local development.
The startup log states whether the current mode is Resend API, SMTP relay, or DEV mode.
Fixed local verification code
Local automated tests can set a fixed verification code:
APP_ENV=development
MULTICA_DEV_VERIFICATION_CODE=888888The code must be 6 digits. The fixed code only takes effect when APP_ENV is explicitly set to development, dev, local, or test; it is ignored for empty APP_ENV, production, prod, staging, or any other value.
Do not enable a fixed code on a publicly reachable instance. The production combination is APP_ENV=production with an empty MULTICA_DEV_VERIFICATION_CODE.
Google sign-in
Create an OAuth 2.0 client in the Google Cloud Console.
Add the Multica frontend's callback URL to Authorized redirect URIs:
https://multica.example.com/auth/callbackSet:
GOOGLE_CLIENT_ID=xxxxx.apps.googleusercontent.com
GOOGLE_CLIENT_SECRET=GOCSPX-xxxxxxxxxxxxxxx
GOOGLE_REDIRECT_URI=https://multica.example.com/auth/callbackRestart the API service.
The URLs in the Google Console and in GOOGLE_REDIRECT_URI must match exactly, including protocol, port, and trailing slash. Once configured, the sign-in page shows a Google sign-in button; the frontend image needs no rebuild.
Signup restrictions
Three variables together decide whether a new account can be created:
| Variable | Effect |
|---|---|
ALLOWED_EMAILS | Full email addresses allowed to sign up, comma-separated |
ALLOWED_EMAIL_DOMAINS | Email domains allowed to sign up, comma-separated |
ALLOW_SIGNUP | Whether signup is allowed when no allowlist is configured; defaults to true |
The evaluation order is:
- The email matches
ALLOWED_EMAILS— allow. - Or its domain matches
ALLOWED_EMAIL_DOMAINS— allow. - With no allowlist configured and
ALLOW_SIGNUP=true— allow. - Otherwise, if the email has a pending, unexpired workspace invitation — allow.
- Otherwise — reject.
Common configurations:
# Company domain and invited users
ALLOW_SIGNUP=false
ALLOWED_EMAIL_DOMAINS=company.com
# Also admit one external collaborator
ALLOWED_EMAILS=partner@example.netBoth allowlists also work as an explicit exception list when ALLOW_SIGNUP=false.
Invitations and signup restrictions
A pending, unexpired workspace invitation allows its email address to create an account even when ALLOW_SIGNUP=false or the address does not match ALLOWED_EMAILS or ALLOWED_EMAIL_DOMAINS. This exception also applies when ALLOW_SIGNUP=true with an allowlist configured: allowlists are not a hard boundary against invited users.
Existing users can continue to sign in. New users without a matching allowlist entry or open signup need a pending, unexpired invitation; missing, expired, accepted, declined, and revoked invitations do not grant signup permission. The invitation is checked when requesting a login code and again when creating the account, including Google sign-in.
You do not need to add ordinary invitees to ALLOWED_EMAILS or restart the server. The invitation must still be accepted through the normal invitation flow to join the workspace.
Revoking an invitation does not delete an account already created using it or prevent that existing account from signing in.
Invitations bypass only signup restrictions (ALLOW_SIGNUP, ALLOWED_EMAILS, and ALLOWED_EMAIL_DOMAINS). They do not bypass ACCESS_ALLOWED_EMAILS when an instance access allowlist is configured.
Instance access allowlist
To restrict who can sign in and use the instance at all — including existing accounts and invited users — set ACCESS_ALLOWED_EMAILS. Each comma-separated, case-insensitive entry is either an exact address or *@domain for every address on that domain:
ACCESS_ALLOWED_EMAILS=*@example.com,contractor@partner.com- Empty (default): no instance-wide restriction; only the signup rules above apply.
- Sign-in and API enforcement: checked before signup restrictions. Verification-code and Google sign-in refuse any unlisted email, and every authenticated API request from an unlisted account returns
403withcode: "access_not_allowed". This covers browser sessions, personal access tokens, daemon tokens, and agent task tokens. WebSocket connections are refused too: a handshake authenticated by the session cookie gets403, and a client that authenticates in its first message receives the same error and is disconnected. Already signed-in web and Desktop sessions are ended and shown the access notice on the sign-in page. - Channels and queued runs: bound IM channel messages and Slack slash commands from excluded accounts are refused before creating chats, issues, or runs. Queued runs originated by an excluded account are failed when a daemon picks them up, before they start.
- Domain matching and validation:
*@example.commatches onlyexample.com, not subdomains such asdev.example.com(list them separately). Internationalized domains must use their ASCII (xn--...) form. Any malformed entry (such asexample.comwithout*@) stops the backend from starting. - Applying changes: restart the API service after changing
ACCESS_ALLOWED_EMAILS.
Session lifetime
Sessions slide. The lifetime below is an idle bound, not a countdown from sign-in: once a session drops below half of it, the next request re-issues it with a full lifetime again, so an account in continuous use is never signed out on a schedule. There is no absolute cap.
The bound is one-sided. A session is only re-issued once it is past the halfway point, so a session last used while it still had more than half its lifetime left is not extended. The idle gap a session is guaranteed to survive is only half the value below.
Adjust with AUTH_TOKEN_TTL, which accepts a Go duration or a positive integer of seconds:
AUTH_TOKEN_TTL=720hThe minimum is 60s; anything shorter is clamped up to it and logs a warning at startup. Below that, the renewal cadence the server derives would fall under the floor clients apply to it, and clients would check for renewal less often than the session can survive.
Restart the API service after changing it. The value applies to sessions issued or re-issued afterwards. Because sessions slide, an existing session picks up the new lifetime the next time it is re-issued.
Next steps
- Environment variables — the full variable reference.
- Authentication and tokens — sign-in sessions and token types.
- Members and roles — invitations and roles.