...
/ASP.NET Core Authentication Middleware
ASP.NET Core Authentication Middleware
Familiarize yourself with authentication middleware of ASP.NET Core.
We'll cover the following...
We'll cover the following...
{
"AzureAd": {
"Instance": "https://login.microsoftonline.com/",
"Domain": "qualified.domain.name",
"TenantId": "22222222-2222-2222-2222-222222222222",
"ClientId": "11111111-1111-1111-11111111111111111",
"Scopes": "access_as_user",
"CallbackPath": "/signin-oidc"
},
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*"
}Minimal API's app with authentication and authorization middleware
If we launch the playground and navigate to the Swagger URL once the application is built, we will see three endpoints with the following paths:
/unprotected: It can be accessed anonymously and will return theUnprotected endpoint accessedmessage in the response./protected: It requires a valid access token to be supplied in the request header. If so, it will return theProtected endpoint accessedmessage. Otherwise, it will return the401response code./admin: It requires not only a valid access token ...