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
@@ -71,11 +71,11 @@ If you want to manually configure your application and code sample, use the foll
71
71
3. Depending on the version of Visual Studio, you might need to right-click the project **AppModelv2-WebApp-OpenIDConnect-DotNet** and then select **Restore NuGet packages**.
72
72
4. Open the Package Manager Console by selecting **View** > **Other Windows** > **Package Manager Console**. Then run `Update-Package Microsoft.CodeDom.Providers.DotNetCompilerPlatform -r`.
73
73
74
-
5. Edit *Web.config* and replace the parameters `ClientId`, `Tenant`, and `redirectUri` with:
5. Edit *appsettings.json* and replace the parameters `ClientId`, `Tenant`, and `redirectUri` with:
75
+
```json
76
+
"ClientId":"Enter_the_Application_Id_here"/>
77
+
"TenantId": "Enter_the_Tenant_Info_Here"/>
78
+
"RedirectUri" :"https://localhost:44368/"/>
79
79
```
80
80
In that code:
81
81
@@ -100,48 +100,30 @@ This section gives an overview of the code required to sign in users. This overv
100
100
You can set up the authentication pipeline with cookie-based authentication by using OpenID Connect in ASP.NET with OWIN middleware packages. You can install these packages by running the following commands in Package Manager Console within Visual Studio:
The OWIN middleware uses a *startup class* that runs when the hosting process starts. In this quickstart, the *startup.cs* file is in the root folder. The following code shows the parameters that this quickstart uses:
@@ -155,10 +137,6 @@ public void Configuration(IAppBuilder app)
155
137
|`TokenValidationParameters`| A list of parameters for token validation. In this case, `ValidateIssuer` is set to `false` to indicate that it can accept sign-ins from any personal, work, or school account type. |
156
138
|`Notifications`| A list of delegates that can be run on `OpenIdConnect` messages. |
157
139
158
-
159
-
> [!NOTE]
160
-
> Setting `ValidateIssuer = false` is a simplification for this quickstart. In real applications, validate the issuer. See the samples to understand how to do that.
161
-
162
140
### Authentication challenge
163
141
164
142
You can force a user to sign in by requesting an authentication challenge in your controller:
@@ -182,6 +160,24 @@ public void SignIn()
182
160
183
161
You can protect a controller or controller actions by using the `[Authorize]` attribute. This attribute restricts access to the controller or actions by allowing only authenticated users to access the actions in the controller. An authentication challenge will then happen automatically when an unauthenticated user tries to access one of the actions or controllers decorated by the `[Authorize]` attribute.
184
162
163
+
### Call Microsoft Graph from the controller
164
+
165
+
You can call Microsoft Graph from the controller by getting the instance of GraphServiceClient using the `GetGraphServiceClient` extension method on the controller, like in the following code:
0 commit comments