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
Copy file name to clipboardExpand all lines: 1-WebApp-OIDC/1-5-B2C/README.md
+13-2Lines changed: 13 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,6 +38,14 @@ Navigate to the `"1-5-B2C"` folder
38
38
cd"1-5-B2C"
39
39
```
40
40
41
+
## Option 1 - Run the pre-configured sample
42
+
43
+
1. Build the solution and run it.
44
+
1. Open your web browser and make a request to the app. Accept the IIS Express SSL certificate if needed. Click on **SignIn/Up** button.
45
+
1. Click on Sign-In
46
+
47
+
## Option 2 - Configure the sample with your own B2C app
48
+
41
49
### Step 2: Get your own Azure AD B2C tenant
42
50
43
51
If you don't have an Azure AD B2C tenant yet, you'll need to create an Azure AD B2C tenant by following the [Tutorial: Create an Azure Active Directory B2C tenant](https://azure.microsoft.com/documentation/articles/active-directory-b2c-get-started).
@@ -57,7 +65,7 @@ Now you need to [register your web app in your B2C tenant](https://docs.microsof
57
65
Your web application registration should include the following information:
58
66
59
67
- Enable the **Web App/Web API** setting for your application.
60
-
- Set the **Reply URL** to `https://localhost:44321/signin/B2C_1_sign_up_in` and `https://localhost:44321/signout/B2C_1_sign_up_in`.
68
+
- Set the **Reply URL** to `https://localhost:44136/signin/B2C_1_sign_up_in` and `https://localhost:44136/signout/B2C_1_sign_up_in`.
61
69
- Copy the Application ID generated for your application, so you can use it in the next step.
62
70
63
71
### Step 5: Configure the sample with your app coordinates
@@ -82,7 +90,7 @@ Your web application registration should include the following information:
82
90
}
83
91
```
84
92
85
-
### Step 5: Run the sample
93
+
### Step 6: Run the sample
86
94
87
95
1. Build the solution and run it.
88
96
1. Open your web browser and make a request to the app. Accept the IIS Express SSL certificate if needed. Click on **SignIn/Up** button.
@@ -100,6 +108,9 @@ If your web site needs to be accessed from users using iOS 12, you probably want
100
108
101
109
## About The code
102
110
111
+
#### Where is MSAL?
112
+
This sample does NOT use MSAL - it uses the built-in ASP.NET Core middlerware. MSAL is used for fetching access for accessing protected APIs (not shown here), as well as ID tokens. For logging-in purposes, it is sufficient to obtain an ID Token, and the middlerware is capable of doing this on its own.
113
+
103
114
The `AccountController.cs` used in this sample is part of the built-in .NET Core authentication controllers found in the NuGet package `Microsoft.AspNetCore.Authentication.AzureADB2C.UI`, and you can find its implementation [here](https://github.com/aspnet/AspNetCore/blob/master/src/Azure/AzureAD/Authentication.AzureADB2C.UI/src/Areas/AzureADB2C/Controllers/AccountController.cs). If you want to customize the **Sign-in**, **Sign-up** or **Sign-out** actions, you are encouraged to create your own controller.
104
115
105
116
This sample shows how to use the OpenID Connect ASP.NET Core middleware to sign in users from a single Azure AD B2C tenant. The middleware is initialized in the `Startup.cs` file by passing the default authentication scheme and `AzureADB2COptions.cs` options. The options are read from the `appsettings.json` file. The middleware takes care of:
0 commit comments