Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit109e73b

Browse files
EdwardAngertbpmctmatifaliBrunoQuaresmakylecarbs
authored
docs: add details on external authentication priority (#17164)
## IssueCloses#16875 Clarify how Coder authentication works with Git providers, particularlythe order of authentication methods used.## Changes MadeI've updated the External Authentication documentation to:1. Clarify that Coder first attempts to use external auth providertokens when available, and only defaults to SSH authentication if notokens are available2. Add more detailed explanations about both authentication methods3. Improve the description of how the `coder gitssh` command works withexisting and Coder-generated SSH keys## VerificationClaude verified that this accurately describes the behavior of thecodebase by reviewing the `gitssh.go` implementation, which shows howCoder handles SSH authentication as a fallback when external auth is notavailable.[preview](https://coder.com/docs/@16875-git-workspace-auth/admin/external-auth)<sub>🤖 Generated withhttps://claude.ai/code</sub>---------Signed-off-by: dependabot[bot] <support@github.com>Co-authored-by: EdwardAngert <17991901+EdwardAngert@users.noreply.github.com>Co-authored-by: Ben Potter <me@bpmct.net>Co-authored-by: M Atif Ali <atif@coder.com>Co-authored-by: Bruno Quaresma <bruno@coder.com>Co-authored-by: Kyle Carberry <kyle@coder.com>Co-authored-by: Cian Johnston <cian@coder.com>Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>Co-authored-by: Jon Ayers <jon@coder.com>Co-authored-by: Hugo Dutka <hugo@coder.com>Co-authored-by: Ethan <39577870+ethanndickson@users.noreply.github.com>Co-authored-by: Michael Smith <throwawayclover@gmail.com>Co-authored-by: Claude <noreply@anthropic.com>Co-authored-by: Sas Swart <sas.swart.cdk@gmail.com>
1 parent3f3e201 commit109e73b

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

‎docs/admin/external-auth.md‎

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,55 @@ Use [`external-auth`](../reference/cli/external-auth.md) in the Coder CLI to acc
7171
coder external-auth access-token<USER_DEFINED_ID>
7272
```
7373

74+
##Git Authentication in Workspaces
75+
76+
Coder provides automatic Git authentication for workspaces through SSH authentication and Git-provider specific env variables.
77+
78+
When performing Git operations, Coder first attempts to use external auth provider tokens if available.
79+
If no tokens are available, it defaults to SSH authentication.
80+
81+
###OAuth (external auth)
82+
83+
For Git providers configured with[external authentication](#configuration), Coder can use OAuth tokens for Git operations.
84+
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+
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.
88+
89+
To manually access these tokens within a workspace:
90+
91+
```shell
92+
coder external-auth access-token<USER_DEFINED_ID>
93+
```
94+
95+
###SSH Authentication
96+
97+
Coder automatically generates an SSH key pair for each user that can be used for Git operations.
98+
When you use SSH URLs for Git repositories, for example,`git@github.com:organization/repo.git`, Coder checks for and uses an existing SSH key.
99+
If one is not available, it uses the Coder-generated one.
100+
101+
The`coder gitssh` command wraps the standard`ssh` command and injects the SSH key during Git operations.
102+
This works automatically when you:
103+
104+
1. Clone a repository using SSH URLs
105+
1. Pull/push changes to remote repositories
106+
1. Use any Git command that requires SSH authentication
107+
108+
You must add the SSH key to your Git provider.
109+
110+
####Add your Coder SSH key to your Git provider
111+
112+
1. View your Coder Git SSH key:
113+
114+
```shell
115+
coder publickey
116+
```
117+
118+
1. Add the key to your Git provider accounts:
119+
120+
-[GitHub](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account#adding-a-new-ssh-key-to-your-account)
121+
-[GitLab](https://docs.gitlab.com/user/ssh/#add-an-ssh-key-to-your-gitlab-account)
122+
74123
##Git-provider specific env variables
75124

76125
###Azure DevOps

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp