Last post May 15, 2019 12:09 AM by bruce (sqlwork.com)
May 14, 2019 08:22 PM|Curious Ray|LINK
I have created a authorization policy and registered the handler in the startup.cs file. I would like to redirect the user to a custom error page when the policy fails, but always get redirected to /Account/AccessDenied?ReturnUrl=MyPage. I cannot seem
to figure out how to register a custom error page. I have tried a few options like having app.UseStatusCodePages. Any help is greatly appreciated
May 14, 2019 09:42 PM|DA924|LINK
You could use the logic and just throw an exception and let the logic display an error page.
May 15, 2019 12:09 AM|bruce (sqlwork.com)|LINK
your custom error pages need to allow anonymous access, or just like you case, it redirects to login.