fix(sdk-api): route authenticate() to v2 login - #9716
Merged
Conversation
Contributor
Contributor
|
|
mohammadalfaiyazbitgo
left a comment
Contributor
There was a problem hiding this comment.
Change looks good, but we need to be explicit that the signature change is a breaking change.
pranishnepal
force-pushed
the
WCN-2652
branch
from
September 11, 2026 12:16
1834f87 to
a072c44
Compare
/api/auth/v1/session is behind a Cloudflare managed challenge that HTTP/Node clients cannot complete, breaking the documented SDK login flow. Route bitgo.authenticate() to /api/v2/user/login instead. Also: - Make authenticateWithAccessToken async and await the HMAC strategy setToken() so the token is registered before the caller issues any subsequent signed request (closes a race for async strategies like WebCryptoHmacStrategy). Await at both callers (fetchEncryptedPrivKeys, upgrade-wallet-encryption). - Update unit test nocks to the v2 login endpoint; add a test for the ECDH-encrypted-token path; keep extensible passthrough. BREAKING CHANGE: authenticateWithAccessToken now returns Promise<void> instead of void. Callers that relied on synchronous completion must await it; login now routes through /api/v2/user/login. TICKET: WCN-2652
pranishnepal
force-pushed
the
WCN-2652
branch
from
September 11, 2026 12:30
a072c44 to
873e1ac
Compare
Migrate all example callers to await the async authenticateWithAccessToken API before issuing signed requests. Move authentication out of synchronous CommonJS config modules and into their async consumers, while exposing the access token through the config objects. Authenticate the same SDK or BitGo client used by each consumer. Also update Promise coroutine examples to yield authentication and preserve synchronous config exports. Ticket: WCN-2652 TICKET: WCN-2652
mohammadalfaiyazbitgo
approved these changes
Sep 11, 2026
nayandas190
approved these changes
Sep 11, 2026
raj-bitgo
approved these changes
Sep 11, 2026
davidkaplanbitgo
approved these changes
Sep 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
/api/auth/v1/session is behind a Cloudflare managed challenge that HTTP/Node clients cannot complete, breaking the documented SDK login flow. Route bitgo.authenticate() to /api/v2/user/login instead.
Also:
Ticket: WCN-2652
Note to Reviewers:
Commit 1 - the change mentioned above
Commit 2 - migration of the examples
Testing