You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The username/password exchange mechanism is (rightfully) deprecated, the
device flow is now in beta, and seems to be the perfect replacement.
This change includes a best-guess of how this might work with GitHub
Enterprise but I haven't tested that, so GitHub Enterprise will continue
to default to the deprecated flow.
Fixes#315
Copy file name to clipboardExpand all lines: README.md
+20-3
Original file line number
Diff line number
Diff line change
@@ -84,9 +84,26 @@ To read a gist and print it to STDOUT
84
84
85
85
## Login
86
86
87
-
If you want to associate your gists with your GitHub account, you need to login
88
-
with gist. It doesn't store your username and password, it just uses them to get
89
-
an OAuth2 token (with the "gist" permission).
87
+
Before you use `gist` for the first time you will need to log in. There are two supported login flows:
88
+
89
+
1. The Github device-code Oauth flow. This is the default for authenticating to github.com, and can be enabled for Github Enterprise by creating an Oauth app, and exporting the environment variable `GIST_CLIENT_ID` with the client id of the Oauth app.
90
+
2. The (deprecated) username and password token exchange flow. This is the default for GitHub Enterprise, and can be used to log into github.com by exporting the environment variable `GIST_USE_USERNAME_AND_PASSWORD`.
91
+
92
+
### The device-code flow
93
+
94
+
This flow allows you to obtain a token by logging into GitHub in the browser and typing a verification code. This is the preferred mechanism.
The returned access_token is stored in `~/.gist` and used for all future gisting. If you need to you can revoke access from https://github.com/settings/connections/applications/4f7ec0d4eab38e74384e.
103
+
104
+
### The username-password flow
105
+
106
+
This flow asks for your GitHub username and password (and 2FA code), and exchanges them for a token with the "gist" permission (your username and password are not stored). This mechanism is deprecated by GitHub, but may still work with GitHub Enterprise.
0 commit comments