Unable to find /oauth/device/code Auth0 Java API


Is there an API to fetch the device code via Auth0 Java API, we use the following snippet in Go, the question is if there is a standard API or should we make a HTTP request call

url := "https://dev-foo.us.auth0.com/oauth/device/code"

payload := strings.NewReader("client_id=RO6N7mr&scope=openid&audience=https://dev-foo.us.auth0.com/api/v2/")

req, _ := http.NewRequest("POST", url, payload)


The documentation tells you that you need to send a POST request like the following:

POST https://YOUR_DOMAIN/oauth/device/code




and the response would look like

HTTP/1.1 200 OK
Content-Type: application/json
  "expires_in":900, //in seconds

enter image description here

Answered By – Lajos Arpad

Answer Checked By – David Marino (GoLangFix Volunteer)

Leave a Reply

Your email address will not be published.