Skip to content

Commit 215f156

Browse files
committed
update the file
1 parent 23f54c8 commit 215f156

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

support/entra/entra-id/app-integration/401-unauthorized-aspnet-core-web-api.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,12 @@ public class MyController : ControllerBase
4141

4242
## Cause
4343

44-
the API might return 401 Unauthorized responses in the following scenarios:
44+
The API might return 401 Unauthorized responses in the following scenarios:
4545

46-
- The request does not include a valid Authorization: Bearer token header.
46+
- The request doesn't include a valid Authorization: Bearer token header.
4747
- Token is expired or incorrect.
4848
- The token being issued for a different resource.
49-
- Token claims not meeting the application's application's token validation criteria as defined in the [JwtBearerOptions.TokenValidationParameters](/dotnet/api/microsoft.aspnetcore.authentication.jwtbearer.jwtbeareroptions.tokenvalidationparameters) class.
49+
- Token claims not meeting the application's token validation criteria as defined in the [JwtBearerOptions.TokenValidationParameters](/dotnet/api/microsoft.aspnetcore.authentication.jwtbearer.jwtbeareroptions.tokenvalidationparameters) class.
5050

5151
## Solution
5252

@@ -55,7 +55,7 @@ To debug and resolve 401 Unauthorized errors, you can use the `JwtBearerEvents`
5555
The `JwtBearerEvents` class has the following callback properties (invoked in the following order) that can help us debug these 401 Access Denied or UnAuthorization issues:
5656

5757
- [`OnMessageRecieved`](/dotnet/api/microsoft.aspnetcore.authentication.jwtbearer.jwtbearerevents.onmessagereceived?view=aspnetcore-2.2#Microsoft_AspNetCore_Authentication_JwtBearer_JwtBearerEvents_OnMessageReceived) is called first for every request.
58-
- [`OnAuthenticationFailed`](/dotnet/api/microsoft.aspnetcore.authentication.jwtbearer.jwtbearerevents.onauthenticationfailed?view=aspnetcore-2.2) is called when the token does not pass the application's token validation criteria.
58+
- [`OnAuthenticationFailed`](/dotnet/api/microsoft.aspnetcore.authentication.jwtbearer.jwtbearerevents.onauthenticationfailed?view=aspnetcore-2.2) is called when the token doesn't pass the application's token validation criteria.
5959
- [`OnChallenge`](/dotnet/api/microsoft.aspnetcore.authentication.jwtbearer.jwtbearerevents.onchallenge?view=aspnetcore-2.2) is called last before a 401 response is returned.
6060

6161
### Step 1: Enable PII logging
@@ -164,7 +164,7 @@ public void ConfigureServices(IServiceCollection services)
164164
```
165165
### Sample results
166166

167-
With the above implementation, when a 401 Unauthorized error occurs, the response output should include detailed error messages, such as:
167+
With the implementation, when a 401 Unauthorized error occurs, the response output should include detailed error messages, such as:
168168

169169
```Output
170170
OnMessageRecieved:

0 commit comments

Comments
 (0)