dnsimple / dnsimple-node

The DNSimple API client for Node.js.
https://developer.dnsimple.com/
MIT License
47 stars 19 forks source link

Authentication fails on sandbox for some reason? #154

Closed softmarshmallow closed 1 year ago

softmarshmallow commented 1 year ago

The request,

curl  -H 'Authorization: Bearer <token>' \
      -H 'Accept: application/json' \
      -X GET \
      https://api.dnsimple.com/v2/1010/registrar/domains/example.com/check

JS

const { q } = req.query;
return client.registrar.checkDomain(process.env.DNSIMPLE_ACCOUNT_ID, q);

Returning message

Error: {"message":"Authentication failed","description":"Authentication error"}

The response does not provide enough information.

I cannot use the api. blocked from the authorization.

@aeden


Edit - seems like it fails on https://api.sandbox.dnsimple.com, but works on https://api.dnsimple.com.

This seams like an internal issue. Is the docs outdated or is this a temporal issue?

(Tested with the same code, only altering the baseurl.)

aeden commented 1 year ago

If you use an access token issues from dnsimple.com, it will not work on sandbox.dnsimple.com. You need to get the access token from sandbox.dnsimple.com to use on sandbox.dnsimple.com.

softmarshmallow commented 1 year ago

Is this supposed to be documented somewhere?

jacegu commented 1 year ago

@softmarshmallow you can read about our sandbox environment in our API overview: https://developer.dnsimple.com/sandbox/. There is also a section in our readme about how to setup the client to target the Sandbox environment: https://github.com/dnsimple/dnsimple-node#sandbox-environment