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
In the `Startup.Configure` method, enable the middleware for serving logs UI. Place a call to the `UseSerilogUi` middleware after authentication and authorization middlewares otherwise authentication may not work for you:
By default serilog-ui allows access to log page only for local requests. In order to give appropriate rights for production use, configuring authorization.You can secure log viewer by allwoing specific users or roles to view logs:
authOption.AuthenticationType=AuthenticationType.Jwt; // or AuthenticationType.Cookie
53
82
authOptions.Usernames=new[] { "User1", "User2" };
54
83
authOptions.Roles=new[] { "AdminRole" };
55
84
})
@@ -58,9 +87,7 @@ public void ConfigureServices(IServiceCollection services)
58
87
.
59
88
.
60
89
```
61
-
Only `User1` and `User2` oruserswith `AdminRole` rolecanviewlogs.
90
+
Only `User1` and `User2` oruserswith `AdminRole` rolecanviewlogs.Ifyouset `AuthenticationType` to `Jwt`, youcansetjwttokenand `Authorization` headerwillbeaddedtotherequestandfor `Cookie` justloginintoyouwebsiteandnoextrastepisrequired.
0 commit comments