Skip to content

Commit fc7b334

Browse files
authored
Update README for XeroOAuth2Sample
1 parent 222d7f9 commit fc7b334

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

XeroOAuth2Sample/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ The use case of our app is to sign users in user Xero Sign In and retrieve and d
55
This sample is an extension of the [XeroSignInSample](../XeroSignInSample)
66

77
**Pre-requisite**:
8-
- 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).
8+
- 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).
99
- You may want to read through Xero's [OAuth2.0 documentation](https://developer.xero.com/documentation/oauth2/overview) to familiarise yourself with the OAuth2.0 flow.
1010

1111
## Getting started with this sample.
@@ -140,10 +140,10 @@ private static Func<TokenValidatedContext, Task> OnTokenValidated()
140140

141141
Now that we've configured how we want our users to be authenticated, we've got to enable and enforce it.
142142

143-
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.
144-
143+
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.
145144
```
146145
app.UseAuthentication();
146+
app.UseAuthorization();
147147
```
148148

149149
Looking at the *OutstandingInvoices* route on our [HomeController](XeroOAuth2Sample/Controllers/HomeController.cs), you'll see that we've set the route to require authorized users using the `Authorize` attribute. This route does not care which scheme (*XeroSgnIn*/*XeroSignUp*) was used when a user was previously authenticated, and will use the default scheme (which you'll remember we set earlier) to authenticate the user if the user is not authenticated.

0 commit comments

Comments
 (0)