-
-
Notifications
You must be signed in to change notification settings - Fork 159
Closed
Description
Description
There is a problem in initialization middleware for JsonAPI and order.
All works fine untl authentication [Authorize] attribute in controller is setup.
After [Authorize] attribute is setup:
- in case UseJsonAPI is used before app.UseAuthentication() , system is not able to find authentiation middleware. custome error handler works.
Below error is received for jsonapi controllers also no-json api controller where authentication is enabled.
{
"ErrorCode": 0,
"FriendlyMessage": "Endpoint xxxxxxxxController.GetAsync (xxxxxxx contains authorization metadata, but a middleware was not found that supports authorization.\nConfigure your application startup by adding app.UseAuthorization() inside the call to Configure(..) in the application startup code. The call to app.UseAuthorization() must appear between app.UseRouting() and app.UseEndpoints(...)."
}
- in cas UseJsonApi is used after .Useendpoints()..., JsonApi , attached error is received.
also custom error handler ( not jsonapi ) does not work
Note: no-jsonapi controllers with authentication in this case works fine.
...
Environment
- JsonApiDotNetCore Version: 4.0.0 - alpha4
- Other Relevant Package Versions: .net core 3.1
error2.txt
tnx.
m
Metadata
Metadata
Assignees
Labels
No labels