question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bitgo not Authentication with Access Token

See original GitHub issue

I set up my access token as instructed in the documentation. I tried this

var BitGo = require('bitgo');
var bitgo = new BitGo.BitGo({ accessToken: ACCESS_TOKEN }); 
bitgo.session({}, function(err,res) {
  console.dir(err);
  console.dir(res);
});

And this is what i get as response.

{ expectedHmac: '74497164697c9709b4c5e98a673738824cf71b908de173d896a2c80012677456',
     receivedHmac: undefined,
     hmacInput: '|/api/v1/client/constants|200|{"ttl":3600,"constants":{"maxFee":100000000,"maxFeeRate":10200,"minFeeRate":0,"minInstantFeeRate":-1000,"fallbackFeeRate":1020,"minOutputSize":2730,"defaultGasPrice":30000000000000,"bitgoEthAddress":"0x0f47ea803926926f299b7f1afc8460888d850f47","enableSegwit":true,"eth":{"tokens":[{"type":"terc","tokenContractAddress":"0x945ac907cf021a6bcd07852bb3b8c087051706a9","decimalPlaces":1},{"type":"tbst","tokenContractAddress":"0xe5cdf77835ca2095881dd0803a77e844c87483cd","decimalPlaces":0}]}}}',
     requestToken: 'My Access Token goes here',
     bitgoToken: 'My access token also goes here' },
  status: 511 }
at errFromResponse (/home/proctor/coinkudi_node/node_modules/bitgo/src/bitgo.js:83:15)
    at handleResponseError (/home/proctor/coinkudi_node/node_modules/bitgo/src/bitgo.js:100:11)
    at tryCatcher (/home/proctor/coinkudi_node/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/home/proctor/coinkudi_node/node_modules/bluebird/js/release/promise.js:512:31)
    at Promise._settlePromise (/home/proctor/coinkudi_node/node_modules/bluebird/js/release/promise.js:569:18)
    at Promise._settlePromise0 (/home/proctor/coinkudi_node/node_modules/bluebird/js/release/promise.js:614:10)
    at Promise._settlePromises (/home/proctor/coinkudi_node/node_modules/bluebird/js/release/promise.js:689:18)
    at Async._drainQueue (/home/proctor/coinkudi_node/node_modules/bluebird/js/release/async.js:133:16)
    at Async._drainQueues (/home/proctor/coinkudi_node/node_modules/bluebird/js/release/async.js:143:10)
    at Immediate.Async.drainQueues (/home/proctor/coinkudi_node/node_modules/bluebird/js/release/async.js:17:14)
    at runCallback (timers.js:800:20)
    at tryOnImmediate (timers.js:762:5)
    at processImmediate [as _immediateCallback] (timers.js:733:5)
  status: 401,
  result: 
   { error: 'unauthorized',
     name: 'Unauthorized',
     requestId: 'cjc2k95u20pvjg9rscb0xod38' },
  invalidToken: true }


Can someone please point out what i did wrong.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7

github_iconTop GitHub Comments

6reactions
ukorcommented, May 23, 2018

@paparyku Yes i did - I was using access token from production site bitgo.com while i was on test environment. If you are on test environment. get your access token from test.bitgo.com

0reactions
ukorcommented, Feb 24, 2020

Check that you are not setting it a new value any where?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Resources - BitGo
User Authentication. Lock Session. Locks the current user session. This disallows operations that require an unlocked token, such as sending a transaction.
Read more >
BitGo REST API
BitGo's SDK and Express App secures tokens using our Auth V2 protocol, which does not send the access token over the wire. For...
Read more >
Advanced Wallet Operations - Resources - BitGo
In your file explorer go to BitGoJS/modules/core/example/v2; Create a file and name it 'list-wallet-addresses.js'; Set your accessToken, and walletId ...
Read more >
Wallet Operations - BitGo
The third BitGo key is not sufficient to sign transactions alone, and BitGo will only ... authenticateWithAccessToken({ accessToken }); const wallet = yield ......
Read more >
Create Access Tokens • BitGo Docs
The following returns a long-lived access token with privileges for all available scopes: ... 1import { BitGoAPI } from '@bitgo/sdk-api'; 2const bitgo =...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found