Auth migration guide
Overview
The endpoint POST /auth is deprecated and retires on March 24, 2027.
To migrate, call POST /auth/tokens (Create Session Token) with your clientID and clientSecret, and send the returned Bearer token, plus the dw-client-app-key header, on every API call.
This is a credential change, not only a URL change. POST /auth/tokens does not accept your username, password, or appTypeID. See Before You Start.
Before You Start
You need three values for each environment. Sandbox and production credentials are separate.
| Item | Used for |
|---|---|
clientID | Request body of POST /auth/tokens. |
clientSecret | Request body of POST /auth/tokens. |
dw-client-app-key | Header on the token request and on every later API call. |
Make the token request from your server only, never from a mobile app or browser. See the Authorization guide for how to protect these values.
Endpoint Replacement Matrix
| Deprecated endpoint | Replacement endpoint | Notes |
|---|---|---|
POST /auth | POST /auth/tokens | Sandbox host https://bo-api.drivewealth.io, production host https://bo-api.drivewealth.net. |
Field Mapping
Request
| Deprecated field | Replacement source |
|---|---|
username | clientID (request body) |
password | clientSecret (request body) |
appTypeID | No replacement. Remove it from your request. |
The dw-client-app-key header is a new requirement, not a replacement for appTypeID. Send it on the token request and on every later API call.
Response
| Deprecated field | Replacement source |
|---|---|
authToken | access_token |
expiresAt | expires_in, in seconds. Compute the expiry time. |
userID | userID |
parentIBID | partnerID |
firstName, lastName | Call GET /users/USERID with the returned userID. |
POST /auth/tokens also returns token_type (always Bearer).
Key normalization differences to handle in client code:
expires_inis a string ("3600"), not a number. Parse it before you do any math.expiresAtwas a timestamp.expires_inis a number of seconds, so compute the expiry from the time you made the request.access_tokenis a signed JWT. Don't log it.- Every API call needs both
Authorization: Bearer {access_token}anddw-client-app-key. A request without the app key fails even with a valid token.
Recommended Migration Pattern
-
Get your
clientID,clientSecret, anddw-client-app-keyfor sandbox. -
Replace the
POST /authrequest withPOST /auth/tokens:curl --location 'https://bo-api.drivewealth.io/back-office/auth/tokens' \ --header 'dw-client-app-key: YOUR_APP_KEY' \ --header 'Content-Type: application/json' \ --data '{ "clientID": "YOUR_CLIENT_ID", "clientSecret": "YOUR_CLIENT_SECRET" }' -
Send both headers on every API call:
curl --location 'https://bo-api.drivewealth.io/back-office/users/USERID' \ --header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \ --header 'dw-client-app-key: YOUR_APP_KEY' -
Cache the token and refresh it at about 55 minutes. Tokens last 60 minutes. Don't request a new token for each API call. DriveWealth expects roughly 5 to 10 token requests per hour per implementer.
-
Build a compatibility object for downstream consumers that still expect the old shape.
-
Repeat with production credentials against the production host.
Compatibility Object Example
{
"authToken": "<from access_token>",
"expiresAt": "<request time + expires_in seconds, as an ISO 8601 timestamp>",
"userID": "<from userID>",
"parentIBID": "<from partnerID>"
}The old firstName and lastName are not in this response. Call GET /users/USERID with the returned userID.
Migration Checklist
- Replace all direct calls to
POST /auth. - Store the new
clientID,clientSecret, anddw-client-app-keyin a secrets manager, not in code or logs. - Send
Authorization: Beareranddw-client-app-keyon every API call. - Parse
expires_inas a string and refresh the token at about 55 minutes. - Remove reads of
authToken,expiresAt,firstName, andlastNamefrom the token response. Read names fromGET /users/USERIDinstead. - Add integration tests for:
- token request and response parsing,
- both headers on downstream calls,
- refresh before expiry,
- behavior on
401.
- Remove the old
usernameandpasswordfrom code, configuration, and logs.
If a request returns 401, check these in order: the dw-client-app-key header, an expired token, the wrong environment, and rotated credentials. See the Authorization guide for the full list.
Updated 6 days ago