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: XeroSignInSample/README.md
+3-2Lines changed: 3 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ This is an example dotnet core MVC application making use of Xero sign in.
4
4
This sample does not include using OAuth2.0 to make requests against Xero's public API.
5
5
6
6
**Pre-requisite**:
7
-
- This sample is a .NET Core 2.2 application, so you'll need to install [.NET Core SDK 2.2 or above](https://dotnet.microsoft.com/download).
7
+
- This sample is a .NET Core 3.1 application, so you'll need to install [.NET Core SDK 3.1 or above](https://dotnet.microsoft.com/download).
8
8
9
9
## Getting started with this sample.
10
10
@@ -59,9 +59,10 @@ This section is where your OAuth2.0 client details, and requested scopes are bei
59
59
60
60
Now that we've configured how we want our users to be authenticated, we've got to enable and enforce it.
61
61
62
-
Looking at the *configure* method in the same `Startup` class, you'll see the following line of code. **Note**: it's important that this line of code exists before the `UseMvc` line so that the request pipeline can enforce authentication prior to routing the requests to your controllers.
62
+
Looking at the *configure* method in the same `Startup` class, you'll see the following line of code. **Note**: it's important that these lines of code exist in this order between the `UseRouting` and `UseEndpoints` lines so that the request pipeline can enforce authentication prior to routing the requests to your controllers.
63
63
```
64
64
app.UseAuthentication();
65
+
app.UseAuthorization();
65
66
```
66
67
67
68
Looking at the *Hello* route on our [HomeController](XeroSignInSample/Controllers/HomeController.cs), you'll see that we've set the route to require authorized users using the `Authorize` attribute.
0 commit comments