Skip to content
This repository has been archived by the owner on Apr 23, 2019. It is now read-only.

how to get Digital Ocean Access Token and ssh ID #133

Open
acandael opened this issue Oct 28, 2014 · 6 comments
Open

how to get Digital Ocean Access Token and ssh ID #133

acandael opened this issue Oct 28, 2014 · 6 comments
Labels

Comments

@acandael
Copy link

Hi,
I'm trying out the Testing Kitchen instructions. I created an Access Token, 'test', on Digital Ocean and created an SSH Key.

then I try to receive the id's with the curl command:

curl -X GET https://api.digitalocean.com/v2/account/keys -H "Authorization: test $DIGITALOCEAN_ACCESS_TOKEN"

but when I run this command, I get an identification failure. I'm not sure what data in the above command to replace with my own data.

Thanks for your help,

Anthony

@jvanbaarsen
Copy link
Contributor

@acandael Did you run export DIGITALOCEAN_ACCESS_TOKEN=abcdefg before running the curl command?

@acandael
Copy link
Author

yeah,
on my local machine I ran:

export DIGITALOCEAN_ACCESS_TOKEN=test
export DIGITALOCEAN_SSH_KEY_IDS=test
$ curl -X GET https://api.digitalocean.com/v2/account/keys -H "Authorization: test $DIGITAL_OCEAN_ACCESS_TOKEN"

the error message I'm getting is:

{"id":"unauthorized","message":"Unable to authenticate you."}

@jvanbaarsen
Copy link
Contributor

@acandael The command needs to be: curl -X GET https://api.digitalocean.com/v2/account/keys -H "Authorization: Bearer <YOUR_DIGITALOCEAN_ACCESS TOKEN>" You have replaced Bearer with test But it needs to be Bearer

@jvanbaarsen
Copy link
Contributor

@acandael Did this answer your question?

@acandael
Copy link
Author

acandael commented Nov 4, 2014

yes, but it didn't solve my issue, I still wasn't able to authenticate.

@jvanbaarsen
Copy link
Contributor

@acandael Ah ok. So your command looks like:
$ curl -X GET https://api.digitalocean.com/v2/account/keys -H "Authorization: Bearer $DIGITAL_OCEAN_ACCESS_TOKEN"?
What happens if you don't use the exported var, but just entered the token inside the curl command, like so: $ curl -X GET https://api.digitalocean.com/v2/account/keys -H "Authorization: Bearer <your_token>"

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants