From b897f8eb7dce08cdc811c55aa7f99fbfed79c81b Mon Sep 17 00:00:00 2001 From: Gabe Torres <69164745+gabtorre@users.noreply.github.com> Date: Mon, 23 Sep 2024 15:02:41 -0700 Subject: [PATCH] Clarify what name to use in alloworgsmap 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 --- docs/admin/auth/index.mdx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/docs/admin/auth/index.mdx b/docs/admin/auth/index.mdx index c1b8905cb..539e8de14 100644 --- a/docs/admin/auth/index.mdx +++ b/docs/admin/auth/index.mdx @@ -89,7 +89,7 @@ Then add the following lines to your site configuration: "clientSecret": "replace-with-the-oauth-client-secret", "allowSignup": false, // CAUTION: Set to true to enable signup. If nothing is specified in `allowOrgs` or `allowOrgsMap`, any GitHub user can sign up. "allowOrgs": ["your-org-name"], // Restrict logins and sign-ups if enabled to members of these orgs. - "allowOrgsMap": { "orgName": ["your-team-name"]} // Restrict logins and sign-ups if enabled to members of teams that belong to a given org. + "allowOrgsMap": { "orgName": ["Your Team Name"]} // Restrict logins and sign-ups if enabled to members of teams that belong to a given org. } ] } @@ -154,15 +154,20 @@ When combined with `"allowSignup": false` or unset, an admin should first create 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. + 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. + ```json { "type": "github", // ... "allowOrgsMap": { "org1": [ - "team1", "subteam1" + "Your Team Name" ], "org2": [ + "team1", "subteam1" + ], + "org3": [ "subteam2" ] }