-
Notifications
You must be signed in to change notification settings - Fork 288
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Method to delete an authorized application? #303
Comments
Hi @csandanov ! |
Any updates? |
Hey @csandanov, The SDK does not currently support revoking Oauth tokens. It's something we may add in the future, but there are still some questions around how we want to approach it. In the meantime, here's a quick Go example for revoking a DigitalOcean Oauth token for anyone landing here: package main
import (
"log"
"net/url"
"golang.org/x/oauth2"
)
const (
revokeUrl = "https://cloud.digitalocean.com/v1/oauth/revoke"
)
func main() {
token := "theoauthtokenhere"
tokenSource := oauth2.StaticTokenSource(&oauth2.Token{AccessToken: token})
client := oauth2.NewClient(oauth2.NoContext, tokenSource)
params := url.Values{}
params.Set("token", token)
resp, err := client.PostForm(revokeUrl, params)
if err != nil {
log.Fatalf("Error revoking token: %s", err.Error())
}
log.Printf("Response status: %s", resp.Status)
} |
I have an app integration with DigitalOcean and when a user deletes the integration on my app I want to delete it on DigitalOcean. As I understand this could be achieved via https://developers.digitalocean.com/documentation/oauth/#revoke-token-flow, right? Currently as I understand there's no such method in the sdk.
The text was updated successfully, but these errors were encountered: