Windows and anonymous authentication side by side

I need help authenticating users based on their location. The problem is this: if users access a website outside the domain, the user must fill out the login page, and the credentials provided to him must be authenticated from the user credential store. If the user is an Active Directory user, he should be redirected to the resource he needs without asking for credentials.

If I allow anonymous Auth and Windows Auth for the web server, anonymous Auth first appears, and even the user is an Active Directory user. I can’t access his domain information.

Anyone can help?

+3
source share
2 answers

One of the ways I know is to set up a single page, for example AdLogin.aspx, to refuse anonymous users and put them in the Authentication Forms module. Then you need to create a custom page with error 401, which redirects to the Forms login page from your AdLogin. The only thing I don’t like is that AD users try to go to the Forms login page all the time, and it’s hard to bookmark the AdLogin page because it just does an automatic redirect. I also don't like the fact that it is so dependent on the IIS user configuration.

See my answer here: ASP.NET Application for Authentication in Active Directory or SQL Using Windows Authentication or Forms Authentication

+1

- -?

, Windows Auth, - . , auth, .

"" () -, . , , , .

0

Source: https://habr.com/ru/post/1776654/


All Articles