The Authorization Server (https://auth.3b4sf.com) is where an org is connected
to the 3B platform services. Once an admin has onboarded an org, the PDF Engine
and Large Files Service can act on that org when called with a valid 3B
sessionKey for it.
An org is onboarded once: an admin completes the onboarding form and approves an OAuth connection as an integration user. After that, no further action is needed until the authorization is revoked or the OAuth app changes.
| Route | Purpose |
|---|---|
GET / |
The onboarding form (the "index page"). |
GET /addClient |
Submitted by the onboarding form. Redirects to Salesforce to authorize. |
GET /oauth/callback |
Salesforce redirects back here after the integration user approves access. |
GET /getToken?sessionKey=<sessionKey> |
Used by the 3B services to obtain access for an onboarded org. |
GET /health |
Health check. |
A successful getToken response:
{
"success": true,
"responseObject": {
"sessionId": "<access-token>",
"expiresIn": 3600,
"instanceUrl": "https://<your-domain>.my.salesforce.com"
}
}
Onboarding is two stages: create an OAuth app in Salesforce, then complete the 3B onboarding form.
You need an External Client App or a classic Connected App. Either works. One app usually already exists per 3B product; only create a new one if there isn't one.
3B Authorization.https://auth.3b4sf.com/oauth/callbackManage user data via APIs (api)Perform requests at any time (refresh_token, offline_access) (required)Note on External Client Apps: enable the app's OAuth flow for the Authorization Code and Refresh Token grant types, and make sure it is enabled and installed in the org before onboarding.
Collect four values first:
| Field | Where to find it |
|---|---|
| Org ID | Setup > Company Information (the 15 or 18 character org id). |
| Org My Domain | Setup > My Domain: the full login URL, for example https://<your-domain>.my.salesforce.com. |
| Client ID (Consumer Key) | The External Client App or Connected App from Stage 1. |
| Client Secret | The same app. |
Then:
https://auth.3b4sf.com/.The org is now onboarded. Service calls with a valid sessionKey for that org will succeed.
The user who approves in step 4 determines the permissions the 3B services act with. Approve as a dedicated integration user with the access the 3B apps need.
Enter the org's own My Domain URL and onboarding works with any org type:
https://acme.my.salesforce.com.https://acme--uat.sandbox.my.salesforce.com. Do not use test.salesforce.com.Onboard each org separately, with its own domain and its own OAuth app.
Re-authorize when the authorization has been revoked, the OAuth app's secret was rotated, the integration user changed, or a service returns "not onboarded" for an org you know was set up.
https://auth.3b4sf.com/.How long is a sessionKey valid? It is time-limited. When it expires, services return "Invalid or expired sessionKey" and the page must fetch a new one.
Do callers manage the Salesforce token lifecycle? No. The 3B services handle Salesforce access for the onboarded org.
Do I need to onboard sandbox and production separately? Yes. Each org (by Org ID and My Domain) is onboarded independently, typically with its own OAuth app.
Does onboarding store our password? No. Onboarding uses an OAuth grant approved by your integration user. No username or password is collected.
One OAuth app per org or per product? A Connected App or External Client App typically already exists per 3B product; reuse it. Create a new one only if none exists or you need to isolate a client.
Which user should approve the OAuth prompt? A dedicated integration user with the access the 3B apps require. The services act with that user's permissions.
| Message | Cause | Fix |
|---|---|---|
Missing orgId, clientId, clientSecret |
A form field was left blank. | Fill in all four fields. |
Org not found [<id>]. Start the workflow again |
The approval step was reached without completing the form first, or with a different Org ID. | Restart from https://auth.3b4sf.com/. |
Failed to obtain oAuth2 token. … (redirect_uri_mismatch) |
The app's callback URL isn't exactly https://auth.3b4sf.com/oauth/callback. |
Fix the callback URL on the External Client App or Connected App. |
Failed to obtain oAuth2 token. … (invalid_client_id / invalid_client) |
Wrong Consumer Key or Secret, or the app isn't fully propagated yet. | Re-copy the consumer key and secret; wait a few minutes after creating the app. |
Failed to obtain oAuth2 token. … (invalid_grant) |
Wrong My Domain host, or the approval took too long. | Confirm the My Domain URL and re-run the flow promptly. |
Missing sessionKey parameter |
The call was made without a sessionKey. | Ensure the caller passes the sessionKey. |
Invalid or expired sessionKey |
The sessionKey is invalid or expired. | Fetch a fresh sessionKey from the page and retry. |
Org with id <id> not onboarded. |
The org was never onboarded, or its authorization was revoked. | Re-authorize the org. |
Failed to refresh oAuth2 token. … (invalid_grant) |
The authorization was revoked (password reset, app uninstalled, admin revoke). | Re-authorize the org. |