Logging out

Logout via OAuth

Introduction

Once logged in via OAuth it is possible to log out.

  • If you log out on the browser, all applications will be logged out.
  • If you log out through a third-party integration, you will only be logged out of that specific application.

Deleting the token

To log out, send an API call to https://auth.eagleeyenetworks.com/oauth2/revoke with the token that you want to revoke. If you revoke a refresh token, the matching access token will also be removed.

๐Ÿ“˜

Note

The API call must be performed as a POST HTTP request with the token in the body of the request. The content type must be application/x-www-form-urlencoded.

curl --request 'POST' \
  --url 'https://auth.eagleeyenetworks.com/oauth2/revoke' \
  --header 'Content-Type: application/x-www-form-urlencoded' \
  --header 'Authorization: Basic <clientid:clientsecrets>.base64()' \
  --data-urlencode 'token=<token value>'
import requests

url = "https://auth.eagleeyenetworks.com/oauth2/revoke"

data = {
    'token': '<token value>'
}
headers = {
    'Content-Type': 'application/x-www-form-urlencoded',
    'Authorization': 'Basic <clientid:clientsecret>.base64()'
}

response = requests.post(
  url,
  headers=headers,
  auth=(
    'CLIENT_ID',
    'CLIENT_SECRET'
  ),
  data=data
)

print(response.text)
package main

import (
    "bytes"
    "encoding/json"
    "fmt"
    "net/http"
    "net/url"
    "io"
)

func main() {

    url := "https://auth.eagleeyenetworks.com/oauth2/revoke"
    data := url.Values{}
    data.Set("token", "<token value>")

    req, _ := http.NewRequest("POST", url, bytes.NewBufferString(data.Encode()))

    req.Header.Add("Content-Type", "application/x-www-form-urlencoded")
    req.SetBasicAuth(clientId, clientSecret)

    res, _ := http.DefaultClient.Do(req)

    defer res.Body.Close()
    body, _ := io.ReadAll(res.Body)

    fmt.Println(string(body))
}

Response:

HTTP 200 OK