Expand description
OAuth device flow implementation.
Implements the GitHub OAuth device flow as described in https://docs.github.com/en/apps/oauth-apps/building-oauth-apps/authorizing-oauth-apps#device-flow.
The flow:
- Request a device code from
POST /login/device/code - Show the user a one-time code and URL
- Poll
POST /login/oauth/access_tokenuntil the user completes authorization - Return the access token
Structs§
- Access
Token Response - Response from
POST /login/oauth/access_token(success). - Device
Code Response - Response from
POST /login/device/code.
Functions§
- display_
instructions - Display the device activation instructions to the user.
- poll_
for_ token - Poll for the access token until the user completes authorization or the flow times out.
- request_
device_ code - Request a device code from GitHub.