coinbase-node icon indicating copy to clipboard operation
coinbase-node copied to clipboard

UnauthorizedError: invalid signature

Open milescs opened this issue 9 years ago • 7 comments

While attempting to create a new wallet with the Coinbase-node API I am constantly getting errors back from the client.getAccounts() call.

var Client = require('coinbase').Client;

var client = new Client({
  'apiKey': 'privateKeyHere',
  'apiSecret': 'privateKeyHere'
});

client.getAccounts({}, function(err, accounts) {
  console.log(err);
  accounts.forEach(function(acct) {
    console.log('my bal: ' + acct.balance.amount + ' for ' + acct.name);
  });
});

I console logged my client and I am successfully connecting to Coinbase. Can anyone see what I am doing wrong?

milescs avatar Nov 30 '17 01:11 milescs

Same error for me

MillHaus33 avatar Dec 28 '17 18:12 MillHaus33

Same in 2018.... Coinbase are u here ?

scredii avatar Mar 10 '18 13:03 scredii

Same as of June 2018.... Has anyone fixed this?

Olivierlu1 avatar Jun 06 '18 04:06 Olivierlu1

Well... I can tell sadly that I get this in 2019... error: AuthenticationError: invalid signature even when the error is clear enough the apiKey/apiSecret are correct according to the API Access dashboard.

mayoralito avatar Apr 27 '19 02:04 mayoralito

So it turns out that they are deprecating (apparently) usage of apiKey/apiSecret. I tested using

var Client = require('coinbase').Client;
client = new Client({
                    'accessToken': '', 
                    'refreshToken': ''
                });

client.getAccounts({}, function(err, accounts) {
  console.log(err);
  accounts.forEach(function(acct) {
    console.log('my bal: ' + acct.balance.amount + ' for ' + acct.name);
  });
});

And this time it worked!

mayoralito avatar Apr 27 '19 03:04 mayoralito

Omg was this mentioned anywhere? I was following the docs and nothing was working for me.

wodinga avatar Jun 28 '19 03:06 wodinga

Hi, we are closing out PRs + Issues as this project is being archived.

drewrothstein avatar Jan 16 '20 05:01 drewrothstein