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
azure-devops: Adjust docs to cover new Entra OAuth apps (#1149)
See sourcegraph/sourcegraph#5504 for more
details, the previous approach has been deprecated by Microsoft and no
longer works.
Closes SRC-1300.
Test plan: Ran through this process locally and ended up with working
perms syncing.
Copy file name to clipboardExpand all lines: docs/admin/config/authorization_and_authentication.mdx
+18-22Lines changed: 18 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -118,39 +118,35 @@ We support authentication through OAuth for Bitbucket Server / Bitbucket Data Ce
118
118
119
119
We support authentication through OAuth for [Azure DevOps Services (dev.azure.com)](https://dev.azure.com) and it is also a prerequisite for [permissions syncing](/admin/permissions/).
120
120
121
-
#### Register a new OAuth application
121
+
#### Register a new Entra OAuth application
122
122
123
-
[Create a new Azure DevOps OAuth application](https://app.vsaex.visualstudio.com/app/register) and follow the instructions below:
123
+
[Create a new Entra OAuth application](https://portal.azure.com/#view/Microsoft_AAD_RegisteredApps/CreateApplicationBlade/quickStartType~/null/isMSAApp~/false) and follow the instructions below:
124
124
125
-
1. In the `Application website` field set the URL of your Sourcegraph instance, for example if the instance is https://sourcegraph.com, then use `https://sourcegraph.com` as the value of this field
126
-
2. Similarly, set the `Authorization callback URL` field to `https://sourcegraph.com/.auth/azuredevops/callback` if your Sourcegraph instance URL is https://sourcegraph.com
127
-
3. Add the following scopes:
128
-
-`User profile (read)`
129
-
-`Identity (read)`
130
-
-`Code (read)`
131
-
-`Project and team (read)`
125
+
1. In the `Name` field pick a descriptive name for this connection
126
+
2. For `Supported account types` select `Accounts in this organizational directory only`
127
+
3. For `Redirect URI` pick `Web`(!) for the type and set the URL field to `https://<myinstance.sourcegraph.com>/.auth/azuredevops/callback` if your Sourcegraph instance URL is https://myinstance.sourcegraph.com
128
+
4. Click **Register**
129
+
5. Now go to the [Microsoft Entra admin center](https://entra.microsoft.com/) as at least an **Application Developer**.
130
+
6. Go to **App registrations** and select the one you just created.
131
+
7. Go to **Manage > Certificates & secrets** and generate a new client secret. Keep the secret value.
132
+
8. Go to **Manage > API Permissions** and click **+ Add a permission**. Select Azure DevOps, then `vso.code`, `vso.identity`, and `vso.project`. Confirm with **Add permissions**.
133
+
9. Go back to **Overview** from the sidebar. Now find the **Endpoints** button at the top center of the page, and take note of the value for **Authority URL (Accounts in this organizational directory only)** (which will look something like _https://login.microsoftonline.com/00000002-0000-0000-c000-000000000000_)
134
+
10. The final value we need to get is the **Application (client) ID** from the **Overview** page. Take note of this UUID as well.
132
135
133
136
#### Configuring Sourcegraph auth.providers
134
137
135
-
Before you add the configuration please ensure that:
136
-
137
-
1. The value of `App ID` from your OAuth application is set as the value of the `clientID` field in the config
138
-
2. The value of `Client Secret` (and not the `App secret`) from your OAuth application is set as the value of the `clientSecret` field
139
-
3. The value of `apiScope` string is a comma separated string and reflects the scopes from your OAuth application accurately
140
-
4. The `type` field has no typos and is **exactly** the same as the example below
141
-
142
-
Add the following to the `auth.providers` key in the site config:
138
+
With all the values acquired above, you can now add the following to the `auth.providers` key in the site config:
0 commit comments