Skip to content

Commit f81e9fe

Browse files
committed
Adding precisions to the README.md and pictures
1 parent 41c8551 commit f81e9fe

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed

README.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ endpoint: AAD V2
1010

1111
This sample shows how to build a .NET Core MVC Web app that uses OpenID Connect to sign in users with their Work and School or Microsoft personal account (formerly live accounts). It leverages the ASP.NET Core OpenID Connect middleware.
1212

13+
![Sign-in with Azure AD](ReadmeFiles/sign-in.png)
14+
1315
For more information on how the protocols work in this scenario and other scenarios, see [Authentication Scenarios for Azure AD](http://go.microsoft.com/fwlink/?LinkId=394414).
1416

1517
## How to run this sample
@@ -100,6 +102,8 @@ Make a request to the app. The app immediately attempts to authenticate you via
100102

101103
## About The code
102104

105+
### ASP.NET Core middleware
106+
103107
This sample shows how to use the OpenID Connect ASP.NET Core middleware to sign in users from a single Azure AD tenant. The middleware is initialized in the `Startup.cs` file by passing it the Client ID of the app and the URL of the Azure AD tenant where the app is registered, which is read from the `appsettings.json` file. The middleware takes care of:
104108

105109
- Downloading the Azure AD metadata, finding the signing keys, and finding the issuer name for the tenant.
@@ -123,6 +127,14 @@ return SignOut(
123127
OpenIdConnectDefaults.AuthenticationScheme);
124128
```
125129

130+
The middleware in this project is created as a part of the open-source [ASP.NET Security](https://github.com/aspnet/Security) project.
131+
132+
### What is specific to Azure AD V2?
133+
134+
ASP.NET Core creates Web applications for the V1 endpoint. It's easy, however to update the code to let users sign-in with both work and school accounts and Microsoft personal accounts. It's also possible to restrict the accounts used to sign-in
135+
136+
#### Modified code
137+
126138
The specific Azure AD V2 code is in `Configure(string name, OpenIdConnectOptions options)`:
127139

128140
```CSharp
@@ -134,4 +146,8 @@ The first line tells the middleware to let sign-in users with the Azure AD V2 en
134146

135147
The second line tells the middleware to not validate the tenants. If you want to validate the tenants, you can set `ValidateIssuer` to true, and add a delegate as the `options.TokenValidationParameters.IssuerValidator` property.
136148

137-
The middleware in this project is created as a part of the open-source [ASP.NET Security](https://github.com/aspnet/Security) project.
149+
#### Variations
150+
151+
You can decide which user accounts can sign-in to your Web App by changing the Authority. The picture below shows all the possibilities
152+
153+
![Variations](ReadmeFiles/v2-variations.png)

ReadmeFiles/sign-in.png

16.5 KB
Loading

ReadmeFiles/v2-variations.png

34.7 KB
Loading

0 commit comments

Comments
 (0)