Base solution for your next web application
Open Closed

Windows Auth / 401 Error #11407


User avatar
0
uabel created

Hello, we are using Windows Authentication in our application. This works very well. We have only one case where we have some problems. And that is when the user cancels the Windows login window.

Then comes a standard error page with a 401 error.

The URL is then: .../MixedAuth?state=c6ET79UdXtie-799oiesuH64HXRbfAmis-iT_7WVlclD4_KodxO9GDodMUwM9hNDnAeh5Z0CItYeil1jEUd883CmrAQTtfsXx5raNleKJKDDq9DqSvwUHguAjdCAx0vmsxmg79gERbNRt3fYivJuwlXCKcAkuamqNDMxhWSzCW2PCKvEjRSAmA8wIJy7jdWX

Is there any way to pick up this error? We would like to respond to it with a redirect. Possibly via a filter or similar ?

ActionResult result = new ChallengeResult("Windows", Url.Action("ExternalLoginCallback", "Account", new { ReturnUrl = returnUrl,Redirect =true})); The ExternalLoginCallback is unfortunately not called in the Cancel case.

Uwe

Markdown is supported
Copy & paste or drag & drop images (max 30 MB per image)

1 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @uabel

    Maybe this can help https://stackoverflow.com/a/64467721. If not, you can create an ASP.NET Core exception filter and handle this specific error.

    Markdown is supported
    Copy & paste or drag & drop images (max 30 MB per image)