Skip to main content

SF-0252 · Scenario · Easy

How to login into a sandbox or production orgs?

✓ Verified by Vikas Singhal · Last reviewed 5/17/2026 · Updated for Spring '26

The login URL tells Salesforce which kind of org you want — production or sandbox. The username then narrows it to a specific org.

Production

  • URL: https://login.salesforce.com (or your My Domain URL, e.g. https://acme.my.salesforce.com).
  • Username: as-is (e.g. alice@acme.com).
  • Password: the production password.

Sandbox

  • URL: https://test.salesforce.com (or your sandbox-specific My Domain URL, e.g. https://acme--uat.sandbox.my.salesforce.com).
  • Username: production username with .sandboxname appended (e.g. alice@acme.com.uat).
  • Password: initially the same as production; usually changed independently after the refresh.

The .sandboxname suffix on the username is what disambiguates between sandboxes when you have multiple.

My Domain in 2026

Salesforce enforced My Domain on all orgs during the Winter ‘22 release, so the login.salesforce.com and test.salesforce.com URLs now redirect to your branded subdomain after the first step. In practice everyone bookmarks the My Domain URL directly:

  • Production: https://acme.my.salesforce.com
  • UAT sandbox: https://acme--uat.sandbox.my.salesforce.com
  • Dev1 sandbox: https://acme--dev1.sandbox.my.salesforce.com

The two-dash format (--sandboxname) is the Salesforce convention.

A few login subtleties

  • You can be logged into multiple orgs at once in the same browser if you use different browser profiles or incognito windows. Trying to log into prod and a sandbox in the same tab will sign you out of the first one.
  • Browser extensions like Salesforce Inspector Reloaded track the current org you’re on — invaluable for not deploying to the wrong one.
  • OAuth login via SSO (Okta, OneLogin, Azure AD, Google) works for both production and sandbox, with separate connected apps usually.
  • SOAP/REST API logins use the same URL discrimination — login.salesforce.com for prod, test.salesforce.com for sandbox. Pointing a Data Loader at the wrong endpoint is the most common “why isn’t this working” issue in early integrations.

Mobile

The Salesforce mobile app has a “URL” setting that lets you point it at sandbox (test.salesforce.com) for the same user account. Useful for testing mobile flows.

What happens if you log in at the wrong URL

  • Production username at test.salesforce.com: login fails with INVALID_LOGIN.
  • Sandbox username at login.salesforce.com: same — INVALID_LOGIN.

The error doesn’t say “wrong environment” — it just refuses, which is why “did I log into the right URL?” is the first thing to check when authentication fails.

In an interview

The clean answer:

  • Production: login.salesforce.com or your My Domain.
  • Sandbox: test.salesforce.com or your --sandboxname My Domain.
  • Username for sandbox is production-username.sandboxname.

That’s the complete answer. If they push deeper, mention OAuth via SSO and the fact that the API uses the same two endpoint hostnames.

Verified against: Salesforce Help — Log In to Salesforce, Salesforce Help — Sandbox Login URLs, Metadata API Developer Guide. Last reviewed 2026-05-17 for Spring ‘26 release.