How to choose correct Salesforce OAuth Authorize and Token URL

Salesforce OAuth URL Selection Guide

If you are using ZappySys Salesforce ODBC Driver or SSIS Salesforce Source or Destination, choosing the correct OAuth /authorize and /token URL is critical for authentication. The domain you use must match the domain your Salesforce org uses when you log into the browser.

Example of ZappySys Salesforce Connection UI


Recommended URL Format (Use This Whenever Possible)

https://<your-domain>.my.salesforce.com/services/oauth2/authorize
https://<your-domain>.my.salesforce.com/services/oauth2/token

Works for:

  • Production
  • Developer Edition
  • Free Trial / Playground
  • Most orgs with My Domain enabled

How to Find Your Correct Domain

  1. Log in to Salesforce in a browser
  2. Look at the URL in the address bar
  3. Use that base domain in your OAuth URLs

Example:
Browser URL:

https://zappysys5-dev-ed.develop.my.salesforce.com/...

Use:

https://zappysys5-dev-ed.develop.my.salesforce.com/services/oauth2/authorize
https://zappysys5-dev-ed.develop.my.salesforce.com/services/oauth2/token

Valid URL Variations You May See

Standard My Domain (most common)

https://<domain>.my.salesforce.com/services/oauth2/token

New Developer Edition cluster

https://<domain>.develop.my.salesforce.com/services/oauth2/token

Legacy Lightning UI domain

https://<domain>.lightning.force.com/services/oauth2/token

Global login for Production

https://login.salesforce.com/services/oauth2/token

Global login for Sandbox

https://test.salesforce.com/services/oauth2/token

DO NOT Hardcode These (Will Break)

:cross_mark: Using instance URLs like https://na85.salesforce.com
:cross_mark: Assuming all orgs behave the same


Quick Rule of Thumb

Use the same domain you see in your browser after login, then append:

/services/oauth2/authorize
/services/oauth2/token

This guarantees correct routing for your Salesforce org.


Optional: Automatic Endpoint Discovery

Advanced users can dynamically discover the OAuth endpoints:

GET https://<domain>/.well-known/openid-configuration

This returns authorization_endpoint, token_endpoint, and more.