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
Copy file name to clipboardExpand all lines: docs/admin/external-auth.md
+16-3
Original file line number
Diff line number
Diff line change
@@ -80,11 +80,24 @@ If no tokens are available, it defaults to SSH authentication.
80
80
81
81
### OAuth (external auth)
82
82
83
-
For Git providers configured with [external authentication](#configuration), Coder can use OAuth tokens for Git operations.
83
+
For Git providers configured with [external authentication](#configuration), Coder can use OAuth tokens for Git operations over HTTPS.
84
+
When using SSH URLs (like `git@github.com:organization/repo.git`), Coder uses SSH keys as described in the [SSH Authentication](#ssh-authentication) section instead.
84
85
85
-
When Git operations require authentication, and no SSH key is configured, Coder will automatically use the appropriate external auth provider based on the repository URL.
86
+
For Git operations over HTTPS, Coder automatically uses the appropriate external auth provider
87
+
token based on the repository URL.
88
+
This works through Git's `GIT_ASKPASS` mechanism, which Coder configures in each workspace.
86
89
87
-
For example, if you've configured a GitHub external auth provider and attempt to clone a GitHub repository, Coder will use the OAuth token from that provider for authentication.
90
+
To use OAuth tokens for Git authentication over HTTPS:
91
+
92
+
1. Complete the OAuth authentication flow (**Login with GitHub**, **Login with GitLab**).
93
+
1. Use HTTPS URLs when interacting with repositories (`https://github.com/organization/repo.git`).
94
+
1. Coder automatically handles authentication. You can perform your Git operations as you normally would.
95
+
96
+
Behind the scenes, Coder:
97
+
98
+
- Stores your OAuth token securely in its database
99
+
- Sets up `GIT_ASKPASS` at `/tmp/coder.<random-string>/coder` in your workspaces
100
+
- Retrieves and injects the appropriate token when Git operations require authentication
88
101
89
102
To manually access these tokens within a workspace:
0 commit comments