Skip to content

Commit c99278b

Browse files
authored
Clarify what name to use in alloworgsmap (#667)
We use the "name" field from the GitHub API response to match the name in alloworgsmap. For example, "Team Name" will work, but "team-name" won't. "name": "Team Name", https://docs.github.com/en/rest/teams/teams?apiVersion=2022-11-28#list-teams-for-the-authenticated-user https://sourcegraph.sourcegraph.com/github.com/sourcegraph/sourcegraph@07ca65aec65a8ce528846277127b061e98a825ee/-/blob/cmd/frontend/internal/auth/githuboauth/session.go?L286 <!-- Explain the changes introduced in your PR --> ## Pull Request approval Although pull request approval is not enforced for this repository in order to reduce friction, merging without a review will generate a ticket for the docs team to review your changes. So if possible, have your pull request approved before merging.
1 parent dfe5f30 commit c99278b

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

docs/admin/auth/index.mdx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ Then add the following lines to your site configuration:
8989
"clientSecret": "replace-with-the-oauth-client-secret",
9090
"allowSignup": false, // CAUTION: Set to true to enable signup. If nothing is specified in `allowOrgs` or `allowOrgsMap`, any GitHub user can sign up.
9191
"allowOrgs": ["your-org-name"], // Restrict logins and sign-ups if enabled to members of these orgs.
92-
"allowOrgsMap": { "orgName": ["your-team-name"]} // Restrict logins and sign-ups if enabled to members of teams that belong to a given org.
92+
"allowOrgsMap": { "orgName": ["Your Team Name"]} // Restrict logins and sign-ups if enabled to members of teams that belong to a given org.
9393
}
9494
]
9595
}
@@ -154,15 +154,20 @@ When combined with `"allowSignup": false` or unset, an admin should first create
154154

155155
Note that subteams inheritance is not supported — the name of child teams (subteams) should be informed so their members can be granted access to Sourcegraph.
156156

157+
When configuring teams in allowOrgsMap, use the team's display name. If the team names do not match exactly, users will be unable to create an account.
158+
157159
```json
158160
{
159161
"type": "github",
160162
// ...
161163
"allowOrgsMap": {
162164
"org1": [
163-
"team1", "subteam1"
165+
"Your Team Name"
164166
],
165167
"org2": [
168+
"team1", "subteam1"
169+
],
170+
"org3": [
166171
"subteam2"
167172
]
168173
}

0 commit comments

Comments
 (0)