Skip to content

Commit 75598a8

Browse files
authored
Merge pull request #240873 from MicrosoftDocs/main
6/08/2023 10AM Publishing
2 parents 6247f81 + 0075d2b commit 75598a8

File tree

94 files changed

+1314
-616
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+1314
-616
lines changed

.openpublishing.redirection.active-directory.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4340,6 +4340,11 @@
43404340
"redirect_url": "/azure/active-directory/external-identities/what-is-b2b",
43414341
"redirect_document_id": true
43424342
},
4343+
{
4344+
"source_path_from_root": "/articles/active-directory/external-identities/azure-ad-account.md",
4345+
"redirect_url": "/azure/active-directory/external-identities/default-account",
4346+
"redirect_document_id": true
4347+
},
43434348
{
43444349
"source_path_from_root": "/articles/active-directory/active-directory-accessmanagement-managing-group-owners.md",
43454350
"redirect_url": "/azure/active-directory/fundamentals/active-directory-accessmanagement-managing-group-owners",

articles/active-directory-b2c/partner-azure-web-application-firewall.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ ms.subservice: B2C
1818

1919
Learn how to enable the Azure Web Application Firewall (WAF) service for an Azure Active Directory B2C (Azure AD B2C) tenant, with a custom domain. WAF protects web applications from common exploits and vulnerabilities.
2020

21+
>[!NOTE]
22+
>This feature is in public preview.
23+
2124
See, [What is Azure Web Application Firewall?](../web-application-firewall/overview.md)
2225

2326
## Prerequisites

articles/active-directory/app-provisioning/application-provisioning-when-will-provisioning-finish-specific-user.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,5 +93,12 @@ Summary of factors that influence the time it takes to complete an **initial cyc
9393

9494
- If performance becomes an issue, and you're attempting to provision most users and groups in your tenant, then use scoping filters. Scoping filters allow you to fine tune the data that the provisioning service extracts from Azure AD by filtering out users based on specific attribute values. For more information on scoping filters, see [Attribute-based application provisioning with scoping filters](define-conditional-rules-for-provisioning-user-accounts.md).
9595

96+
The **incremental cycle** may also take longer than the duration we have documented above. Some of the factors that influence this duration are:
97+
98+
- The number of changes on the individual objects properties.
99+
- The number of changes on the groups memberships.
100+
- The scope of assignment configured for the app. Configuration of **sync assigned users and groups only** is recommended where possible.
101+
102+
96103
## Next steps
97104
[Automate user provisioning and deprovisioning to SaaS applications with Azure Active Directory](user-provisioning.md)

articles/active-directory/authentication/fido2-compatibility.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ ms.collection: M365-identity-device-management
1717
---
1818
# Browser support of FIDO2 passwordless authentication
1919

20-
Azure Active Directory allows [FIDO2 security keys](./concept-authentication-passwordless.md#fido2-security-keys) to be used as a passwordless device. The availability of FIDO2 authentication for Microsoft accounts was [announced in 2018](https://techcommunity.microsoft.com/t5/identity-standards-blog/all-about-fido2-ctap2-and-webauthn/ba-p/288910), and it became [generally available](https://techcommunity.microsoft.com/t5/azure-active-directory-identity/passwordless-authentication-is-now-generally-available/ba-p/1994700) in March 2021. The following diagram shows which browsers and operating system combinations support passwordless authentication using FIDO2 authentication keys with Azure Active Directory.
20+
Azure Active Directory allows [FIDO2 security keys](./concept-authentication-passwordless.md#fido2-security-keys) to be used as a passwordless device. The availability of FIDO2 authentication for Microsoft accounts was [announced in 2018](https://techcommunity.microsoft.com/t5/identity-standards-blog/all-about-fido2-ctap2-and-webauthn/ba-p/288910), and it became [generally available](https://techcommunity.microsoft.com/t5/azure-active-directory-identity/passwordless-authentication-is-now-generally-available/ba-p/1994700) in March 2021. The following diagram shows which browsers and operating system combinations support passwordless authentication using FIDO2 authentication keys with Azure Active Directory. Azure AD currently supports only hardware FIDO2 keys and does not support passkeys for any platform.
2121

2222
## Supported browsers
2323

articles/active-directory/develop/sample-v2-code.md

Lines changed: 295 additions & 60 deletions
Large diffs are not rendered by default.

articles/active-directory/external-identities/customers/how-to-web-app-dotnet-sign-in-prepare-app.md

Lines changed: 120 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,58 @@
11
---
2-
title: Prepare your application - Sign in users to an ASP.NET web app
3-
description: Create and prepare an ASP.NET web app for authentication
2+
title: Tutorial - Prepare an ASP.NET web app for authentication in a customer tenant
3+
description: Learn how to prepare an ASP.NET web app for authentication with your Azure Active Directory (Azure AD) for customers tenant.
44
services: active-directory
55
author: cilwerner
66
ms.author: cwerner
77
manager: celestedg
88
ms.service: active-directory
9-
ms.workload: identity
9+
1010
ms.subservice: ciam
11-
ms.topic: how-to
11+
ms.topic: tutorial
1212
ms.date: 05/23/2023
13-
ms.custom: it-pro
13+
1414
#Customer intent: As a dev, devops, I want to learn about how to enable authentication in my own ASP.NET web app with Azure Active Directory (Azure AD) for customers tenant.
1515
---
1616

17-
# Prepare your application: Sign in users to an ASP.NET web app using an Azure Active Directory (AD) for customers tenant
17+
# Tutorial: Prepare an ASP.NET web app for authentication in a customer tenant
18+
19+
In the [previous article](./how-to-web-app-dotnet-sign-in-prepare-tenant.md), you registered an application and configured user flows in your Azure Active Directory (Azure AD) for customers tenant.
1820

19-
After registering an application and creating a user flow in a Azure Active Directory (AD) for customers tenant, an ASP.NET web application can be created using an integrated development environment (IDE). In this article, you'll create an ASP.NET project in your IDE, and configure it for authentication.
21+
In this tutorial you'll;
22+
23+
> [!div class="checklist"]
24+
> * Create an ASP.NET project in Visual Studio Code
25+
> * Add the required NuGet packages
26+
> * Configure the settings for the application
27+
> * Add code to implement authentication
2028
2129
## Prerequisites
2230

23-
- Completion of the prerequisites and steps in [Sign in users in your own ASP.NET web application by using an Azure AD for customers tenant - Prepare your tenant](./how-to-web-app-dotnet-sign-in-prepare-tenant.md).
24-
- Although any IDE that supports React applications can be used, Visual Studio Code is used for this guide. This can be downloaded from the [Downloads](https://visualstudio.microsoft.com/downloads/) page.
25-
- [.NET 7.0 SDK](https://dotnet.microsoft.com/download/dotnet).
31+
* Completion of the prerequisites and steps in [Prepare your customer tenant for building an ASP.NET web app](./how-to-web-app-dotnet-sign-in-prepare-tenant.md).
32+
* Although any integrated development environment (IDE) that supports ASP.NET applications can be used, this tutorial uses **Visual Studio Code**. You can download it [here](https://visualstudio.microsoft.com/downloads/).
33+
* [.NET 7.0 SDK](https://dotnet.microsoft.com/download/dotnet).
2634

2735
## Create an ASP.NET project
2836

29-
1. Open a terminal in your IDE and navigate to the location in which to create your project.
30-
1. Enter the following command to make the project folder and create your project.
37+
1. Open Visual Studio Code, select **File** > **Open Folder...**. Navigate to and select the location in which to create your project.
38+
1. Open a new terminal by selecting **Terminal** > **New Terminal**.
39+
1. Enter the following command to make a Model View Controller (MVC) ASP.NET project.
3140

3241
```powershell
3342
dotnet new mvc -n aspnet_webapp
3443
```
3544
45+
## Install identity packages
46+
47+
Identity related NuGet packages must be installed in the project to authenticate users.
48+
49+
1. Enter the following commands to change into the *aspnet_webapp* folder and install the relevant NuGet package:
50+
51+
```powershell
52+
cd aspnet_webapp
53+
dotnet add package Microsoft.Identity.Web.UI
54+
```
55+
3656
## Configure the application for authentication
3757
3858
1. Open the *appsettings.json* file and replace the existing code with the following snippet.
@@ -71,7 +91,94 @@ After registering an application and creating a user flow in a Azure Active Dire
7191
1. In the `https` section of `profiles`, change the `https` URL in `applicationUrl` so that it reads `https://localhost:7274`. You used this URL to define the **Redirect URI**.
7292
1. Save the changes to your file.
7393
94+
## Add authorization to *HomeController.cs*
95+
96+
The *HomeController.cs* file contains the code for the home page of the application and needs to have the capability to authorize the user. The `Microsoft.AspNetCore.Authorization` namespace provides the classes and interfaces to implement authorization to the web app, and the `[Authorize]` attribute is used to specify that only authenticated users can use the web app.
97+
98+
1. In your code editor, open *Controllers\HomeController.cs* file.
99+
1. Authorization needs to be added to the controller, add `Microsoft.AspNetCore.Authorization` so that the top of the file is identical to the following snippet:
100+
101+
```cshtml
102+
using System.Diagnostics;
103+
using Microsoft.AspNetCore.Authorization;
104+
using Microsoft.AspNetCore.Mvc;
105+
using aspnet_webapp.Models;
106+
```
107+
108+
1. Additionally, add the `[Authorize]` attribute directly above the `HomeController` class definition.
109+
110+
```csharp
111+
[Authorize]
112+
```
113+
114+
## Add authentication and authorization to *Program.cs*
115+
116+
The *Program.cs* needs to be modified to add authentication and authorization to the web app. This includes adding namespaces for authentication and authorization, and being able to sign in users with the Microsoft identity platform.
117+
118+
1. To add the required namespaces, open *Program.cs* and add the following snippet to the top of the file:
119+
120+
```csharp
121+
using Microsoft.AspNetCore.Authentication.OpenIdConnect;
122+
using Microsoft.AspNetCore.Authorization;
123+
using Microsoft.AspNetCore.Mvc.Authorization;
124+
using Microsoft.Identity.Web;
125+
using Microsoft.Identity.Web.UI;
126+
using System.IdentityModel.Tokens.Jwt;
127+
```
128+
129+
1. Next, add the authentication services to the application which will enable the web app to sign in users with the Microsoft identity platform. You can replace the rest of the code in *Program.cs* with the following snippet:
130+
131+
```csharp
132+
var builder = WebApplication.CreateBuilder(args);
133+
134+
// Add services to the container.
135+
builder.Services.AddControllersWithViews();
136+
137+
// This is required to be instantiated before the OpenIdConnectOptions starts getting configured.
138+
// By default, the claims mapping will map claim names in the old format to accommodate older SAML applications.
139+
// For instance, 'http://schemas.microsoft.com/ws/2008/06/identity/claims/role' instead of 'roles' claim.
140+
// This flag ensures that the ClaimsIdentity claims collection will be built from the claims in the token
141+
JwtSecurityTokenHandler.DefaultMapInboundClaims = false;
142+
143+
// Sign-in users with the Microsoft identity platform
144+
builder.Services.AddAuthentication(OpenIdConnectDefaults.AuthenticationScheme)
145+
.AddMicrosoftIdentityWebApp(builder.Configuration)
146+
.EnableTokenAcquisitionToCallDownstreamApi()
147+
.AddInMemoryTokenCaches();
148+
149+
builder.Services.AddControllersWithViews(options =>
150+
{
151+
var policy = new AuthorizationPolicyBuilder()
152+
.RequireAuthenticatedUser()
153+
.Build();
154+
options.Filters.Add(new AuthorizeFilter(policy));
155+
}).AddMicrosoftIdentityUI();
156+
157+
var app = builder.Build();
158+
159+
// Configure the HTTP request pipeline.
160+
if (!app.Environment.IsDevelopment())
161+
{
162+
app.UseExceptionHandler("/Home/Error");
163+
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
164+
app.UseHsts();
165+
}
166+
167+
app.UseHttpsRedirection();
168+
app.UseStaticFiles();
169+
170+
app.UseRouting();
171+
app.UseAuthorization();
172+
173+
app.MapControllerRoute(
174+
name: "default",
175+
pattern: "{controller=Home}/{action=Index}/{id?}");
176+
177+
app.Run();
178+
179+
```
180+
74181
## Next steps
75182
76183
> [!div class="nextstepaction"]
77-
> [Sign in and sign out](how-to-web-app-dotnet-sign-in-sign-out.md)
184+
> [Sign in and sign out](how-to-web-app-dotnet-sign-in-sign-out.md)

articles/active-directory/external-identities/customers/how-to-web-app-dotnet-sign-in-prepare-tenant.md

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,49 @@
11
---
2-
title: Prepare your tenant - Sign in users to an ASP.NET web app
3-
description: Learn about how to prepare your Azure Active Directory (AD) for customers tenant for customers to sign in users in your own ASP.NET web application by using Azure AD for customers tenant.
2+
title: Tutorial - Prepare your customer tenant to authenticate users in an ASP.NET web app
3+
description: Learn how to configure your Azure Active Directory (Azure AD) for customers tenant for authentication with an ASP.NET web application
44
services: active-directory
55
author: cilwerner
66
manager: celestedg
77

88
ms.author: cwerner
99
ms.service: active-directory
10-
ms.workload: identity
1110
ms.subservice: ciam
12-
ms.topic: how-to
11+
ms.topic: tutorial
1312
ms.date: 05/23/2023
14-
ms.custom: developer
13+
1514
#Customer intent: As a dev, devops, I want to learn about how to enable authentication in my own ASP.NET web app with Azure Active Directory (Azure AD) for customers tenant
1615
---
1716

18-
# Prepare your tenant: Sign in users to an ASP.NET web app using an Azure Active Directory (AD) for customers tenant
17+
# Tutorial: Prepare your customer tenant to authenticate users in an ASP.NET web app
18+
19+
This tutorial series demonstrates how to build an ASP.NET web application from scratch and prepare it for authentication using the Microsoft Entra admin center. You'll use the [Microsoft Authentication Library for .NET](/entra/msal/dotnet) and [Microsoft Identity Web](/dotnet/api/microsoft-authentication-library-dotnet/confidentialclient) libraries to authenticate your app with your Azure Active Directory (Azure AD) for customers tenant. Finally, you'll run the application and test the sign-in and sign-out experiences.
1920

20-
This how-to guide demonstrates how to prepare your Azure Active Directory (Azure AD) for customers tenant for authentication. You'll register a web application in the Microsoft Entra admin center, and record its identifiers. You'll then create a sign in and sign out user flow in the Microsoft Entra admin center and associate your web application with the user flow.
21+
In this tutorial, you'll;
22+
23+
> [!div class="checklist"]
24+
> * Register a web application in the Microsoft Entra admin center, and record its identifiers
25+
> * Create a client secret for the web application
26+
> * Define the platform and URLs
27+
> * Grant permissions to the web application to access the Microsoft Graph API
28+
> * Create a sign in and sign out user flow in the Microsoft Entra admin center
29+
> * Associate your web application with the user flow
2130
2231
## Prerequisites
2332

24-
- Azure AD for customers tenant. If you don't already have one, <a href="https://aka.ms/ciam-free-trial?wt.mc_id=ciamcustomertenantfreetrial_linkclick_content_cnl" target="_blank">sign up for a free trial</a>.
33+
- An Azure subscription. If you don't have one, [create a free account](https://azure.microsoft.com/free/?WT.mc_id=A261C142F) before you begin.
34+
35+
- This Azure account must have permissions to manage applications. Any of the following Azure AD roles include the required permissions:
36+
* Application administrator
37+
* Application developer
38+
* Cloud application administrator
2539

26-
If you have already registered a web application in the Microsoft Entra admin center, and associated it with a user flow, you can skip the steps in this article and move to [Prepare your application](how-to-web-app-dotnet-sign-in-prepare-app.md).
40+
- An Azure AD for customers tenant. If you haven't already, [create one now](https://aka.ms/ciam-free-trial?wt.mc_id=ciamcustomertenantfreetrial_linkclick_content_cnl). You can use an existing customer tenant if you have one.
2741

28-
## Register the web app
42+
## Register the web app and record identifiers
2943

3044
[!INCLUDE [ciam-register-app](./includes/register-app/register-client-app-common.md)]
3145

32-
## Define the platform and URLs
46+
## Add a platform redirect URL
3347

3448
[!INCLUDE [ciam-register-app](./includes/register-app/add-platform-redirect-url-dotnet.md)]
3549

@@ -52,4 +66,4 @@ If you have already registered a web application in the Microsoft Entra admin ce
5266
## Next steps
5367

5468
> [!div class="nextstepaction"]
55-
> [Prepare your application](how-to-web-app-dotnet-sign-in-prepare-app.md)
69+
> [Prepare ASP.NET web app](how-to-web-app-dotnet-sign-in-prepare-app.md)

0 commit comments

Comments
 (0)