Skip to content

Commit d5975df

Browse files
committed
github: use OAuth2/web flow for GitHub
Add an OAuth2 web browser-based authentication flow to replace the username & password flow for GitHub.com and augment the u/p flow for GHE instances.
1 parent e12fd6a commit d5975df

25 files changed

+1140
-87
lines changed

docs/configuration.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,33 @@ Configure GCM Core to use the a proxy for network operations.
136136

137137
**Note:** Git itself does _not_ respect this setting; this affects GCM _only_.
138138

139+
#### Example
140+
139141
```shell
140142
git config --global credential.httpsProxy http://john.doe:[email protected]
141143
```
142144

143145
**Also see: [GCM_HTTP_PROXY](environment.md#GCM_HTTP_PROXY-deprecated)**
146+
147+
---
148+
149+
### credential.gitHubAuthModes
150+
151+
Override the available authentication modes presented during GitHub authentication.
152+
If this option is not set, then the available authentication modes will be automatically detected.
153+
154+
**Note:** This setting supports multiple values separated by spaces.
155+
156+
Value|Authentication Mode
157+
-|-
158+
_(unset)_|Automatically detect modes
159+
`oauth`|OAuth-based authentication
160+
`basic`|Basic/PAT-based authentication
161+
162+
#### Example
163+
164+
```shell
165+
git config --global credential.gitHubAuthModes "oauth basic"
166+
```
167+
168+
**Also see: [GCM_GITHUB_AUTHMODES](environment.md#GCM_GITHUB_AUTHMODES)**

docs/environment.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,3 +280,32 @@ export GCM_HTTP_PROXY=http://john.doe:[email protected]
280280
```
281281

282282
**Also see: [credential.httpProxy](configuration.md#credentialhttpProxy-deprecated)**
283+
284+
---
285+
286+
### GCM_GITHUB_AUTHMODES
287+
288+
Override the available authentication modes presented during GitHub authentication.
289+
If this option is not set, then the available authentication modes will be automatically detected.
290+
291+
**Note:** This setting supports multiple values separated by spaces.
292+
293+
Value|Authentication Mode
294+
-|-
295+
_(unset)_|Automatically detect modes
296+
`oauth`|OAuth-based authentication
297+
`basic`|Basic/PAT-based authentication
298+
299+
##### Windows
300+
301+
```batch
302+
SET GCM_GITHUB_AUTHMODES="oauth basic"
303+
```
304+
305+
##### macOS/Linux
306+
307+
```bash
308+
export GCM_GITHUB_AUTHMODES="oauth basic"
309+
```
310+
311+
**Also see: [credential.gitHubAuthModes](configuration.md#credentialgitHubAuthModes)**

0 commit comments

Comments
 (0)