Open milesstoetzner opened 3 years ago
I think the documentation should either use or at least mention the openid-client
library which implements the device flow.
See https://github.com/panva/node-openid-client#device-authorization-grant-device-flow
Description
Device Authorization Flow Node.js sample code is not encoding data correctly.
The sample code passes a JSON object to axios which expects a string. The solution is to correctly encode the parameters.
This problem should apply to all Node.js examples on the documentation page. I tested this only at the device authorization endpoint and token endpoint.
Here is one sample code of the documentation:
The request sent to the device authorization endpoint using the sample code looks as follows. Note, the data is a stringified JSON and not correctly encoded.
The error repsonse form the device authorization endpoint
Here is an example from the axios documentation to correctly encode the body:
Reproduction
Create a Native Application and follow the tutorial for Device Authorization Flow.
Environment