OAuth Device Flow Beta 404 on code generation?

I’ve filed a support ticket for this as well, but curious if anyone has had success implementing the new Device Flow auth (as described in https://docs.github.com/en/developers/apps/authorizing-oauth-apps#device-flow)? I’m always getting a 404 on the POST to the device/user code generator (Step 1 in the docs). I’ve tried it with both existing and new GitHub and OAuth apps that have been opted-in to the Device Flow beta- I assume I’m missing something dumb and obvious here. In addition to multiple apps in multiple orgs, I’ve tried different scopes (and no scope at all), messing with the Accept header values, all to no avail. Below is a sample POST- pretty much no matter what, I get a 404. Any ideas?

POST https://github.com/login/device/code HTTP/1.1
User-Agent:'ansible-galaxy/2.11.0.dev0 (Linux; python:3.8.5)'
Host:github.com
Content-Length:61
Accept:application/vnd.github.v3+json,application/vnd.github.machine-man-preview+json,application/json,text/json,*/*

{"client_id": "Iv1.1b40da000394f164", "scope": "public_repo"}
1 Like

Just closing the loop here for @nitzmahone’s OP.

As mentioned, there was an internal support ticket created, and the solution was provided:

If you want to provide your client_id as JSON, you’ll need to set the Content-Type header to application/json . Alternatively, you can send this as form data or query parameters with no extra headers.

Just in case anyone happens to come across the same, in their searches!

1 Like