By Jalymo
I rely on personal access tokens which I use to solve DNS challenges for my web servers (I have some domains which point to a private IP for a VPN). My certificate (Let’s Encrypt) expired today, and my web server is unable to solve the DNS challenge because the DigitalOcean API is returning this error every time it attempts to access the API:
“Post "https://api.digitalocean.com/v2/domains/cw-server.cloud/records\”: oauth2: token expired and refresh token is not set (order=https://acme.zerossl.com/v2/DV90/order/zyTp3qewiKYI7N8Y9Wi01w) (ca=https://acme.zerossl.com/v2/DV90)"
I’ve tried re-generating my access token but it doesn’t work. My token is set to never expire (as was my original one), so I’m confused as to why the API thinks I need token refreshing for oauth2 when I don’t even use oauth on the DigitalOcean platform.
Please let me know if I need to provide more info
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hi there,
Can you share the exact API request that you are making?
When using an access token, you need to make sure that you use the DigitalOcean public API:
When using the public API, you should make sure that you pass the token as an Authorization: Bearer header:
curl -X GET \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
"https://api.digitalocean.com/v2/domains/example.com/records"
On the other hand, if you are using the DigitalOcean OAuth API, you would need to make sure that you register your app and follow the steps here on how to use the client secret and client ID to dynamically generate access tokens:
Best,
Bobby
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.