Skip to main content
Getting locked out of your own tool is the worst kind of broken — you can’t even get in to fix it. Most login failures come down to a handful of things, and you can rule them out in a couple of minutes. Start at the top.

Symptoms

  • The app redirects back to login.
  • A backend call is refused as not logged in.
  • A JSON-RPC call fails with a CSRF or session error.
  • The user appears signed in but cannot access expected records.
  • Records from a different tenant appear after working in another tab.
  • Sign-in hangs for a long time before completing.
  • An expired password blocks sign-in.
  • Sign-in is refused even with the right password.
  • A JSON-RPC call or /rest/login answers HTTP 403.
  • You forgot your password.
  • A two-factor code or passkey is refused.
  • You were signed out after a break, or the next morning.

What the message means

The Darpan CLI has its own sign-in messages. See Set up the Darpan CLI.

Checks

  1. Confirm the backend is reachable.
  2. Confirm the frontend is pointed at the intended backend.
  3. Confirm the user is using the correct environment credentials.
  4. Refresh the CSRF token by loading the login page again.
  5. Confirm the user has access to the active tenant.

How the app keeps you signed in

Darpan environments use one of two session modes. Which one applies depends on how the environment was built, not on anything you set. If a fresh tab shows the login page while another tab is still working, you are on a per-tab environment. Sign in again in the new tab.

Lockouts and session length

After three wrong passwords, the account refuses sign-in for five minutes even with the right password. Wait it out rather than retrying, because each retry during the lockout gets the same refusal. While the lockout lasts, authenticator codes and recovery codes are refused too, right ones included, and each still counts toward the 20-in-24-hours code lock. Every attempt is counted before it is checked. If Darpan cannot record an attempt, for example while the database is busy, it refuses that attempt even with the right password and shows the usual invalid username or password message. Try again in a moment. Setting a new password does not end a lockout or re-enable a disabled account, and an admin’s Reset Password doesn’t either. A Darpan admin re-enables a disabled account with Enable in the admin app.

Two-factor

After the password, Darpan asks for a code from your authenticator app, a passkey, or a recovery code. Setup and the sign-in steps: Two-factor sign-in. Lost the phone or key and have no recovery code left? Ask a Darpan admin to reset your two-factor, then set it up again.

Forgot password

Forgot password? appears under the Sign In button only when the instance can send email. If it is missing, ask your Darpan administrator to reset the password. The reset emails a 6-digit code to the account’s recovery email. The code expires in 15 minutes, and Send a new code replaces it. The reset can stop with one of these: A password reset does not turn two-factor off: after the new password, the sign-in still asks for your code or passkey. If you sign in without a recovery email on file, Darpan asks Where should password reset codes go? after sign-in, every time until one is saved. Not now skips it for that sign-in. Saving can be refused with “Enter a valid email address.” or “That email is already in use by another account.” Details: Auth and access.

Records changed after you switched tenant in another tab

The active tenant is stored on your user account on the server, not in the browser tab. Switching tenant in one tab re-points every other tab signed in as the same user, including tabs in other browsers. The next call from those tabs reads and writes the newly selected tenant, even though the page may still show the old one.
  • Reload any other open tabs after switching tenant, and confirm the tenant shown before saving.
  • To work in two tenants side by side, use two different user accounts.
  • Never share a login between a browser user and an API integration. An integration that switches tenant moves the person’s session too, and the reverse.

A session is restored, but a call was still refused

Darpan checks the session by asking the backend, and that check restores the session from the login cookie before answering. So a session probe can report a healthy, authenticated session about a call the backend has just refused. Read the failing call’s own response body rather than the probe or the HTTP status alone. A refused call returns a JSON-RPC error object. A call made without a session is refused with an error message saying the user must be logged in, not with HTTP 401, and depending on the failure the HTTP status may be 500 or 200. A check that only looks for 401 will report success on a refusal.

A call is refused with HTTP 403

/rpc/json dispatches only facade.*, admin.* and gql.* methods. Any other method, such as a stock Moqui service like org.moqui.impl.UserServices.update#Password, gets HTTP 403 before dispatch, signed in or not, and so does every batch that contains one. The framework’s /rest/login endpoint also answers 403.
  • Call a facade.*, admin.* or gql.* method instead.
  • Sign in with facade.AuthFacadeServices.login#Session, not /rest/login.
HTTP Basic credentials, or a username and password sent as request parameters or in a request body, answer HTTP 401 on any route, even when the password is right. Use a session from login#Session or an API key instead. A 403 here is not a session problem: signing in again does not change it.

Sign-in is slow rather than failing

A sign-in that eventually succeeds after a long pause is a different failure from one that is rejected quickly. A slow sign-in points at contention on the account record rather than at the credentials, and it affects everyone signing in against that record, not one person. A fast rejection points at the account state instead: an expired password, a required password change, a lockout, or a disabled account. Wrong two-factor codes count toward the same lockout as wrong passwords. An expired or must-change password is changed on the sign-in page, and a forgotten one through Forgot password, so neither needs an administrator.
Sharing one account across several people makes the slow-sign-in case much more likely, and makes it look intermittent. It also means one person’s tenant switch moves everyone else’s tabs. Give each person their own account.

API testing shape

For API testing, authenticate against the assigned backend and send the session cookie plus X-CSRF-Token with /rpc/json. On a per-tab environment, send the login_key header returned at sign-in instead. Use placeholder values only.
Share only redacted examples in documentation, support threads, or external comments. Real cookies, CSRF tokens, login keys, and passwords stay out of public material.