Skip to content

Commit 7e67105

Browse files
committed
oath git over https
1 parent b0fe626 commit 7e67105

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

docs/admin/external-auth.md

+16-3
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,24 @@ If no tokens are available, it defaults to SSH authentication.
8080

8181
### OAuth (external auth)
8282

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.
8485

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.
8689

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
88101

89102
To manually access these tokens within a workspace:
90103

0 commit comments

Comments
 (0)