I’m using Authorize(Roles = "HRManager,Finance")] on top of each razor pages to restrict user access. ( it works fine). How to redirect the faild access attempt to a customized access denied page?
I developed the access denied page. But,how to call it when a user is not authianticated?
CodePudding user response:
If you use startup ,try :
services.ConfigureApplicationCookie(opts =>
{
opts.AccessDeniedPath = "/xxx/xxx";
});