Connecting to GitHub using device authorization
Connect your GitHub account to Che using the device authorization flow directly from the Dashboard. Device Auth Tokens are GitHub OAuth tokens stored as Kubernetes Secrets. They enable Git operations in your workspaces without requiring a personal access token.
-
Your administrator has configured a GitHub OAuth App with Device Flow enabled as described in Configuring OAuth 2.0 for GitHub.
This feature requires the GitHub OAuth App configuration. It is not available when GitHub authentication is configured using a GitHub App.
-
In the Che dashboard, go to User Preferences > Device Auth Tokens.
-
Click Connect to GitHub.
A modal opens displaying a one-time code.
-
Click the copy button next to the code to copy it to your clipboard.
-
Click github.com/login/device to open the GitHub device activation page.
For GitHub Enterprise Server, replace github.comwith your instance hostname. -
Paste the one-time code on the GitHub page and click Continue.
-
Authorize the application when prompted by GitHub.
The permissions granted are determined by the OAuth App configuration set by your administrator. After successful authorization, the modal closes and the new token appears in the Device Auth Tokens table.
-
Verify that the new token is listed in the Device Auth Tokens table with a valid status.
Deleting device auth tokens
Deleting a device auth token removes the Kubernetes Secret and revokes the GitHub authorization. Device Auth Tokens do not expire automatically. To disconnect your GitHub account, delete the token from this page or revoke access from your GitHub account settings.
-
To delete a single token:
-
Click the actions menu (⋮) on the token row.
-
Click Delete.
-
Select the confirmation checkbox and click Delete.
-
-
To delete multiple tokens:
-
Select the checkboxes next to the tokens you want to delete.
-
Click Delete in the toolbar.
-
Select the confirmation checkbox and click Delete.
-
-
Verify that the deleted token no longer appears in the Device Auth Tokens table.
Troubleshooting
If the one-time code expires before you complete the authorization on GitHub (codes expire after approximately 15 minutes), close the modal and click Connect to GitHub again to start a new device authorization flow.
-
For an alternative Git authentication method, see Access private repositories with a personal access token.