Sign-in and signup
Configure email verification codes, Google sign-in, and who can sign up.
T-agent signs users in with email verification codes by default; Google OAuth can be added on top. Existing users can always sign in again — signup restrictions only decide whether new accounts can be created.
Email verification codes
After the user enters an email address, T-agent sends a 6-digit verification code. The code is valid for 10 minutes; once it 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.com -
Restart 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=agentdock
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
During local development the server can write codes to its log. Set APP_ENV=production on a public instance. Without SMTP or Resend and an explicit sender, email sign-in returns HTTP 503 and no code is logged. Invitations use the public frontend URL in FRONTEND_ORIGIN.
Fixed local verification code
Local automated tests can set a fixed verification code:
APP_ENV=development
AGENTDOCK_DEV_VERIFICATION_CODE=888888The code must be 6 digits. The fixed code is ignored when APP_ENV=production.
Do not enable a fixed code on a publicly reachable instance. The production combination is APP_ENV=production with an empty AGENTDOCK_DEV_VERIFICATION_CODE.
Google sign-in
-
Create an OAuth 2.0 client in the Google Cloud Console.
-
Add the agentdock frontend's callback URL to Authorized redirect URIs:
https://agentdock.example.com/auth/callback -
Set:
GOOGLE_CLIENT_ID=xxxxx.apps.googleusercontent.com GOOGLE_CLIENT_SECRET=GOCSPX-xxxxxxxxxxxxxxx GOOGLE_REDIRECT_URI=https://agentdock.example.com/auth/callback -
Restart 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 match, if
ALLOW_SIGNUP=false— reject. - With
ALLOW_SIGNUP=truebut any allowlist configured and no match — still reject. - With no allowlist configured and
ALLOW_SIGNUP=true— allow.
Common configurations:
# Company domain only
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
Invitations do not automatically bypass signup restrictions:
- If the invitee already has a T-agent account, they can sign in and accept the invitation.
- If they do not, their email must satisfy the signup rules above.
To invite a new member on an instance with open signup disabled, add their email to ALLOWED_EMAILS first. Once the account is created and the invitation accepted, you can remove the entry again.
Session lifetime
Browser sign-ins last 30 days by default. Adjust with AUTH_TOKEN_TTL, which accepts a Go duration or a positive integer of seconds:
AUTH_TOKEN_TTL=720hRestart the API service after changing it. The value only affects sign-in cookies and JWTs issued afterwards; it does not extend tokens that were already issued.
Next steps
- Environment variables — the full variable reference.
- Authentication and tokens — sign-in sessions and token types.
- Members and roles — invitations and roles.
Optional single sign-on
Set AGENTDOCK_OIDC_ISSUER, AGENTDOCK_OIDC_CLIENT_ID and AGENTDOCK_OIDC_CLIENT_SECRET to use your own OIDC provider. Register <FRONTEND_ORIGIN>/auth/oidc/callback with the provider. Keep AGENTDOCK_OIDC_ONLY unset to continue offering email sign-in. Existing users can verify ownership before linking an external identity.
Instance user management
Instance administrators can open /admin/users to view all accounts. Confirming a suspension blocks access across the instance and preserves workspace data. Restoring the account lets the user sign in again. Standalone deployments designate administrators by email in AGENTDOCK_INSTANCE_ADMINS.
Deployments can also enforce suspensions using the comma-separated T_AGENT_DISABLED_USER_IDS or T_AGENT_DISABLED_USER_EMAILS lists. The page identifies these accounts as locked by deployment configuration. Remove the corresponding entries and reload the backend to lift that restriction.