Skip to content

Commit 247afc7

Browse files
authored
First pass. Will go into more detail soon
1 parent 2d7c880 commit 247afc7

File tree

1 file changed

+15
-18
lines changed

1 file changed

+15
-18
lines changed

articles/active-directory/develop/scenario-web-app-sign-user-app-configuration.md

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ ms.service: active-directory
99
ms.subservice: develop
1010
ms.topic: conceptual
1111
ms.workload: identity
12-
ms.date: 07/14/2020
12+
ms.date: 12/8/2022
1313
ms.author: jmprieur
1414
ms.custom: aaddev, devx-track-python
1515
#Customer intent: As an application developer, I want to know how to write a web app that signs in users by using the Microsoft identity platform.
@@ -64,8 +64,16 @@ You might want to refer to this sample for full implementation details.
6464

6565
Web applications that sign in users by using the Microsoft identity platform are configured through configuration files. These are the values you're required to specify in the configuration:
6666

67-
- The cloud instance (`Instance`) if you want your app to run in national clouds, for example
68-
- The audience in the tenant ID (`TenantId`)
67+
- The cloud instance (`Instance`) if you want your app to run in national clouds, for example. The different options include;
68+
- `https://login.microsoftonline.com/` for Azure public cloud
69+
- `https://login.microsoftonline.us/` for Azure US government
70+
- `https://login.microsoftonline.de/` for Azure AD Germany
71+
- `https://login.partner.microsoftonline.cn/common` for Azure AD China operated by 21Vianet
72+
- The audience in the tenant ID (`TenantId`). The options vary depending on whether your app is single tenant or multitenant.
73+
- `TenantId` for a GUID obtained from the Azure portal to sign in users in your organization
74+
- `organizations` to sign in users in any work or school account
75+
- `common` to sign in users with any work or school account or Microsoft personal account
76+
- `consumers` to sign in users with a Microsoft personal account only
6977
- The client ID (`ClientId`) for your application, as copied from the Azure portal
7078

7179
You might also see references to the `Authority`. The `Authority` value is the concatenation of the `Instance` and `TenantId` values.
@@ -77,18 +85,7 @@ In ASP.NET Core, these settings are located in the [appsettings.json](https://gi
7785
```Json
7886
{
7987
"AzureAd": {
80-
// Azure cloud instance among:
81-
// - "https://login.microsoftonline.com/" for Azure public cloud
82-
// - "https://login.microsoftonline.us/" for Azure US government
83-
// - "https://login.microsoftonline.de/" for Azure AD Germany
84-
// - "https://login.partner.microsoftonline.cn/common" for Azure AD China operated by 21Vianet
8588
"Instance": "https://login.microsoftonline.com/",
86-
87-
// Azure AD audience among:
88-
// - "TenantId" as a GUID obtained from the Azure portal to sign in users in your organization
89-
// - "organizations" to sign in users in any work or school account
90-
// - "common" to sign in users with any work or school account or Microsoft personal account
91-
// - "consumers" to sign in users with a Microsoft personal account only
9289
"TenantId": "[Enter the tenantId here]",
9390

9491
// Client ID (application ID) obtained from the Azure portal
@@ -131,7 +128,7 @@ In ASP.NET Core, another file ([properties\launchSettings.json](https://github.c
131128
}
132129
```
133130

134-
In the Azure portal, the redirect URIs that you register on the **Authentication** page for your application need to match these URLs. For the two preceding configuration files, they would be `https://localhost:44321/signin-oidc`. The reason is that `applicationUrl` is `http://localhost:3110`, but `sslPort` is specified (44321). `CallbackPath` is `/signin-oidc`, as defined in `appsettings.json`.
131+
In the Azure portal, the redirect URIs that you register on the **Authentication** page for your application need to match these URLs. For the two preceding configuration files, they would be `https://localhost:44321/signin-oidc`. The reason is that `applicationUrl` is `http://localhost:3110`, but `sslPort` is specified (`44321`). `CallbackPath` is `/signin-oidc`, as defined in `appsettings.json`.
135132

136133
In the same way, the sign-out URI would be set to `https://localhost:44321/signout-oidc`.
137134
> [!NOTE]
@@ -218,7 +215,7 @@ SESSION_TYPE = "filesystem" # So the token cache will be stored in a server-sid
218215
219216
## Initialization code
220217
221-
The initialization code is different depending on the platform. For ASP.NET Core and ASP.NET, signing in users is delegated to the OpenID Connect middleware. The ASP.NET or ASP.NET Core template generates web applications for the Azure Active Directory (Azure AD) v1.0 endpoint. Some configuration is required to adapt them to the Microsoft identity platform. In the case of Java, it's handled by Spring with the cooperation of the application.
218+
The initialization code differences are platform dependant. For ASP.NET Core and ASP.NET, signing in users is delegated to the OpenID Connect middleware. The ASP.NET or ASP.NET Core template generates web applications for the Azure Active Directory (Azure AD) v1.0 endpoint. Some configuration is required to adapt them to the Microsoft identity platform.
222219
223220
# [ASP.NET Core](#tab/aspnetcore)
224221
@@ -227,7 +224,7 @@ In ASP.NET Core web apps (and web APIs), the application is protected because yo
227224
To add authentication with the Microsoft identity platform (formerly Azure AD v2.0), you'll need to add the following code. The comments in the code should be self-explanatory.
228225
229226
> [!NOTE]
230-
> If you want to start directly with the new ASP.NET Core templates for Microsoft identity platform, that leverage Microsoft.Identity.Web, you can download a preview NuGet package containing project templates for .NET Core 3.1 and .NET 5.0. Then, once installed, you can directly instantiate ASP.NET Core web applications (MVC or Blazor). See [Microsoft.Identity.Web web app project templates](https://aka.ms/ms-id-web/webapp-project-templates) for details. This is the simplest approach as it will do all the steps below for you.
227+
> If you want to start directly with the new ASP.NET Core templates for Microsoft identity platform, that leverage Microsoft.Identity.Web, you can download a preview NuGet package containing project templates for .NET 5.0. Then, once installed, you can directly instantiate ASP.NET Core web applications (MVC or Blazor). See [Microsoft.Identity.Web web app project templates](https://aka.ms/ms-id-web/webapp-project-templates) for details. This is the simplest approach as it will do all the steps below for you.
231228
>
232229
> If you prefer to start your project with the current default ASP.NET Core web project within Visual Studio or by using `dotnet new mvc --auth SingleOrg` or `dotnet new webapp --auth SingleOrg`, you'll see code like the following:
233230
>
@@ -381,7 +378,7 @@ Move on to the next article in this scenario,
381378
# [Node.js](#tab/nodejs)
382379
383380
Move on to the next article in this scenario,
384-
[Sign in](./scenario-web-app-sign-user-sign-in.md?tabs=nodejs).
381+
[Sign in and sign out](./scenario-web-app-sign-user-sign-in.md?tabs=nodejs).
385382
386383
# [Python](#tab/python)
387384

0 commit comments

Comments
 (0)