Skip to content

Commit 16fdff6

Browse files
authored
Merge pull request #96930 from ShawnJackson/scenario-web-app-sign-user
edit pass: scenario-web-app-sign-user
2 parents 057ca05 + e1be75d commit 16fdff6

6 files changed

+256
-250
lines changed

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

Lines changed: 91 additions & 93 deletions
Large diffs are not rendered by default.

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

Lines changed: 62 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -15,114 +15,113 @@ ms.workload: identity
1515
ms.date: 10/30/2019
1616
ms.author: jmprieur
1717
ms.custom: aaddev
18-
#Customer intent: As an application developer, I want to know how to write a web app that signs-in users using the Microsoft identity platform for developers.
18+
#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 for developers.
1919
ms.collection: M365-identity-device-management
2020
---
2121

22-
# Web app that signs in users - app registration
22+
# Web app that signs in users: App registration
2323

24-
This page explains the app registration specifics for a web app that signs-in users.
24+
This article explains the app registration specifics for a web app that signs in users.
2525

2626
To register your application, you can use:
2727

28-
- The [web app quickstarts](#register-an-app-using-the-quickstarts) - In addition to being a great first experience with creating an application, quickstarts in the Azure portal contain a button named **Make this change for me**. You can use this button to set the properties you need, even for an existing app. You'll need to adapt the values of these properties to your own case. In particular, the web API URL for your app is probably going to be different from the proposed default, which will also impact the sign-out URI.
29-
- The Azure portal to [register your application manually](#register-an-app-using-azure-portal)
30-
- PowerShell and command-line tools
28+
- The [web app quickstarts](#register-an-app-by-using-the-quickstarts). In addition to being a great first experience with creating an application, quickstarts in the Azure portal contain a button named **Make this change for me**. You can use this button to set the properties you need, even for an existing app. You'll need to adapt the values of these properties to your own case. In particular, the web API URL for your app is probably going to be different from the proposed default, which will also affect the sign-out URI.
29+
- The Azure portal to [register your application manually](#register-an-app-by-using-the-azure-portal).
30+
- PowerShell and command-line tools.
3131

32-
## Register an app using the QuickStarts
32+
## Register an app by using the quickstarts
3333

34-
If you navigate to this link, you can create bootstrap the creation of your web application:
34+
You can use these links to bootstrap the creation of your web application:
3535

3636
- [ASP.NET Core](https://aka.ms/aspnetcore2-1-aad-quickstart-v2)
3737
- [ASP.NET](https://ms.portal.azure.com/#blade/Microsoft_AAD_RegisteredApps/applicationsListBlade/quickStartType/AspNetWebAppQuickstartPage/sourceType/docs)
3838

39-
## Register an app using Azure portal
39+
## Register an app by using the Azure portal
4040

4141
> [!NOTE]
42-
> the portal to use is different depending on if your application runs in the Microsoft Azure public cloud or in a national or sovereign cloud. For more information, see [National Clouds](./authentication-national-cloud.md#app-registration-endpoints)
42+
> The portal to use is different depending on whether your application runs in the Microsoft Azure public cloud or in a national or sovereign cloud. For more information, see [National clouds](./authentication-national-cloud.md#app-registration-endpoints).
4343
4444

45-
1. Sign in to the [Azure portal](https://portal.azure.com) using either a work or school account, or a personal Microsoft account. Alternatively, sign in to the national cloud Azure portal of choice.
46-
1. If your account gives you access to more than one tenant, select your account in the top-right corner, and set your portal session to the desired Azure AD tenant.
47-
1. In the left-hand navigation pane, select the **Azure Active Directory** service, and then select **App registrations** > **New registration**.
45+
1. Sign in to the [Azure portal](https://portal.azure.com) by using either a work or school account, or a personal Microsoft account. Alternatively, sign in to the Azure portal of choice for the national cloud.
46+
1. If your account gives you access to more than one tenant, select your account in the upper-right corner. Then, set your portal session to the desired Azure Active Directory (Azure AD) tenant.
47+
1. In the left pane, select the **Azure Active Directory** service, and then select **App registrations** > **New registration**.
4848

4949
# [ASP.NET Core](#tab/aspnetcore)
5050

51-
4. When the **Register an application** page appears, enter your application's registration information:
52-
1. choose the supported account types for your application (See [Supported Account types](./v2-supported-account-types.md))
53-
1. In the **Name** section, enter a meaningful application name that will be displayed to users of the app, for example `AspNetCore-WebApp`.
54-
1. In **Redirect URI**, add the type of application and the URI destination that will accept returned token responses after successfully authenticating. For example, `https://localhost:44321/`. Select **Register**.
51+
1. When the **Register an application** page appears, enter your application's registration information:
52+
1. Choose the supported account types for your application. (See [Supported account types](./v2-supported-account-types.md).)
53+
1. In the **Name** section, enter a meaningful application name that will be displayed to users of the app. For example, enter **AspNetCore-WebApp**.
54+
1. For **Redirect URI**, add the type of application and the URI destination that will accept returned token responses after successful authentication. For example, enter **https://localhost:44321**. Then, select **Register**.
5555
1. Select the **Authentication** menu, and then add the following information:
56-
1. In **Reply URL**, add `https://localhost:44321/signin-oidc` of type "Web".
57-
1. In the **Advanced settings** section, set **Logout URL** to `https://localhost:44321/signout-oidc`.
58-
1. Under **Implicit grant**, check **ID tokens**.
56+
1. For **Reply URL**, add **https://localhost:44321/signin-oidc** of type **Web**.
57+
1. In the **Advanced settings** section, set **Logout URL** to **https://localhost:44321/signout-oidc**.
58+
1. Under **Implicit grant**, select **ID tokens**.
5959
1. Select **Save**.
6060

6161
# [ASP.NET](#tab/aspnet)
6262

63-
4. When the **Register an application page** appears, enter your application's registration information:
64-
1. choose the supported account types for your application (See [Supported Account types](./v2-supported-account-types.md))
65-
- In the **Name** section, enter a meaningful application name that will be displayed to users of the app, for example `MailApp-openidconnect-v2`.
66-
- In the Redirect URI (optional) section, select **Web** in the combo-box and enter the following redirect URIs: `https://localhost:44326/`.
63+
1. When the **Register an application page** appears, enter your application's registration information:
64+
1. Choose the supported account types for your application. (See [Supported account types](./v2-supported-account-types.md).)
65+
1. In the **Name** section, enter a meaningful application name that will be displayed to users of the app. For example, enter **MailApp-openidconnect-v2**.
66+
1. In the **Redirect URI (optional)** section, select **Web** in the combo box and enter the following redirect URI: **https://localhost:44326/**.
6767
1. Select **Register** to create the application.
68-
1. Select the **Authentication** menu, and then add the following information:
69-
- In the **Advanced settings** | **Implicit grant** section, check **ID tokens** as this sample requires
70-
the [Implicit grant flow](v2-oauth2-implicit-grant-flow.md) to be enabled to sign in the user.
68+
1. Select the **Authentication** menu.
69+
1. In the **Advanced settings** | **Implicit grant** section, select **ID tokens**. This sample requires the [implicit grant flow](v2-oauth2-implicit-grant-flow.md) to be enabled to sign in the user.
7170
1. Select **Save**.
7271

7372
# [Java](#tab/java)
7473

75-
4. When the **Register an application page** appears, enter a friendly name for the application, for example 'java-webapp', select "Accounts in any organizational directory
76-
and personal Microsoft Accounts (e.g. Skype, Xbox, Outlook.com)"
77-
and select 'Web app / API' as the *Application Type*.
78-
1. Click **Register** to register the application.
79-
1. On the left-hand menu, click on **Authentication**, and under *Redirect URIs*, select "Web". You will need to enter
80-
two different redirect URIs: one for the signIn page, and one for the graph page. For both, you should use the same host and port number, then followed by "/msal4jsample/secure/aad" for the sign-in page and "msal4jsample/graph/me" for the user info page.
81-
By default, the sample uses:
74+
1. When the **Register an application page** appears, enter a display name for the application. For example, enter **java-webapp**.
75+
1. Select **Accounts in any organizational directory
76+
and personal Microsoft Accounts (e.g. Skype, Xbox, Outlook.com)**,
77+
and then select **Web app / API** for **Application Type**.
78+
1. Select **Register** to register the application.
79+
1. On the left menu, select **Authentication**. Under **Redirect URIs**, select **Web**.
8280

83-
- `http://localhost:8080/msal4jsample/secure/aad`.
84-
- `http://localhost:8080/msal4jsample/graph/me`
81+
1. Enter two redirect URIs: one for the sign-in page, and one for the graph page. For both, use the same host and port number, followed by **/msal4jsample/secure/aad** for the sign-in page and **msal4jsample/graph/me** for the user information page.
82+
83+
By default, the sample uses:
8584

86-
In the **Advanced settings** section, set **Logout URL** to `http://localhost:8080/msal4jsample/sign_out`.
85+
- **http://localhost:8080/msal4jsample/secure/aad**
86+
- **http://localhost:8080/msal4jsample/graph/me**
8787

88-
Click on **save**.
88+
1. In the **Advanced settings** section, set **Logout URL** to **http://localhost:8080/msal4jsample/sign_out**. Then, select **Save**.
8989

90-
1. Select the **Certificates & secrets** from the menu and in the **Client secrets** section, click on **New client secret**:
90+
1. Select **Certificates & secrets** from the menu.
91+
1. In the **Client secrets** section, select **New client secret**, and then:
9192

92-
- Type a key description
93-
- Select a key duration **In 1 year**.
94-
- The key value will display when you select **Add**.
95-
- Copy the value of the key for later. This key value will not be displayed again, nor retrievable by any other means, so record it as soon as it is visible from the Azure portal.
93+
1. Enter a key description.
94+
1. Select the key duration **In 1 year**.
95+
1. Select **Add**.
96+
1. When the key value appears, copy it for later. This value will not be displayed again or be retrievable by any other means.
9697

9798
# [Python](#tab/python)
9899

99-
4. When the **Register an application page** appears, enter your application's registration information:
100-
- In the **Name** section, enter a meaningful application name that will be displayed to users of the app, for example `python-webapp`.
101-
- Change **Supported account types** to **Accounts in any organizational directory and personal Microsoft accounts (e.g. Skype, Xbox, Outlook.com)**.
102-
- In the Redirect URI (optional) section, select **Web** in the combo-box and enter the following redirect URIs: `http://localhost:5000/getAToken`.
100+
1. When the **Register an application page** appears, enter your application's registration information:
101+
1. In the **Name** section, enter a meaningful application name that will be displayed to users of the app. For example, enter **python-webapp**.
102+
1. Change **Supported account types** to **Accounts in any organizational directory and personal Microsoft accounts (e.g. Skype, Xbox, Outlook.com)**.
103+
1. In the **Redirect URI (optional)** section, select **Web** in the combo box and enter the following redirect URI: **http://localhost:5000/getAToken**.
103104
1. Select **Register** to create the application.
104-
1. On the app **Overview** page, find the **Application (client) ID** value and record it for later. You'll need it to configure the Visual Studio configuration file for this project.
105-
1. From the app's Overview page, select the **Authentication** section.
106-
- In the **Advanced settings** section set **Logout URL** to `http://localhost:5000/logout`
107-
108-
Select **Save**.
109-
1. On the left hand menu, choose **Certificates & secrets** and click on **New client secret** in the **Client Secrets** section:
110-
111-
- Type a key description
112-
- Select a key duration of **In 1 year**.
113-
- When you click on **Add**, the key value will be displayed.
114-
- Copy the value of the key. You will need it later.
105+
1. On the app's **Overview** page, find the **Application (client) ID** value and record it for later. You'll need it to configure the Visual Studio configuration file for this project.
106+
1. Select the **Authentication** section. In **Advanced settings**, set **Logout URL** to **http://localhost:5000/logout**. Then, select **Save**.
107+
1. On the left menu, select **Certificates & secrets**.
108+
1. In the **Client Secrets** section, select **New client secret**, and then:
109+
110+
1. Enter a key description.
111+
1. Select a key duration of **In 1 year**.
112+
1. Select **Add**.
113+
1. When the key value appears, copy it. You'll need it later.
115114
---
116115

117-
## Register an app using PowerShell
116+
## Register an app by using PowerShell
118117

119118
> [!NOTE]
120-
> Currently Azure AD PowerShell only creates applications with the following supported account types:
119+
> Currently, Azure AD PowerShell creates applications with only the following supported account types:
121120
>
122-
> - MyOrg (Accounts in this organizational directory only)
123-
> - AnyOrg (Accounts in any organizational directory).
121+
> - MyOrg (accounts in this organizational directory only)
122+
> - AnyOrg (accounts in any organizational directory)
124123
>
125-
> If you want to create an application that signs-in users with their personal Microsoft Accounts (e.g. Skype, XBox, Outlook.com), you can first create a multi-tenant application (Supported account types = Accounts in any organizational directory), and then change the `signInAudience` property in the application manifest from the Azure portal. This is explained in details in the step [1.3](https://github.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/tree/master/1-WebApp-OIDC/1-3-AnyOrgOrPersonal#step-1-register-the-sample-with-your-azure-ad-tenant) of the ASP.NET Core tutorial (and can be generalized to web apps in any language).
124+
> You can create an application that signs in users with their personal Microsoft accounts (for example, Skype, Xbox, or Outlook.com). First, create a multitenant application. Supported account types are accounts in any organizational directory. Then, change the `signInAudience` property in the application manifest from the Azure portal. For more information, see [step 1.3](https://github.com/Azure-Samples/active-directory-aspnetcore-webapp-openidconnect-v2/tree/master/1-WebApp-OIDC/1-3-AnyOrgOrPersonal#step-1-register-the-sample-with-your-azure-ad-tenant) in the ASP.NET Core tutorial. You can generalize this step to web apps in any language.
126125
127126
## Next steps
128127

0 commit comments

Comments
 (0)