I’m trying to develop an Android DigitalOcean app, and I’m having a hard time with authorization.
Currently, I am using this library to access DigitalOcean’s API from Java. Here’s what I’m doing in terms of authentication:
I pulled the token from the app and tried to manually use it in cURL with
curl -X GET -H 'Content-Type: application/json' -H 'Authorization: Bearer MyTokenFromAppHere' "https://api.digitalocean.com/v2/droplets?page=1&per_page=1"
I also get the unable to authenticate message. Now when I replace the token with a personal token, I get the expected response (a listing of my droplets).
So my main question is, what’s the difference between an OAuth API token, and a personal token? Surely I’m not supposed to ask the user to generate a personal token to plug into the app, right…?
Edit: Also, I tried basic authentication (-u “TokenHere:”) and still the same message.
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Click below to sign up and get $100 of credit to try our products over 60 days!