Windows authentication mode but not required

I am using Windows authentication mode in my asp.net application. If a user logs in correctly, he can access my site without logins. But if this is an external user, when he tries to access the asp.net application, the login dialog is displayed. I do not want this entry to be made.

I want the username to be registered only if the user is registered. but if the user is not registered, I do not want to do anything.

+3
source share
2 answers

You need to use <authentication mode="Windows"/>one that sounds like you. And enable anonymous access in your IIS configuration.

If they are currently logged in, he must submit his credentials. If this is not the case, then the user must select the user in whom the workflow works.

You can see this question with a few more details: How to get the Windows username when issuing ID = "true" in asp.net?

+2
source
<authentication mode="Windows"/> 
 <authorization>
         <deny users="?" />
 </authorization>

This entry in web.config redirects users to the Access Denied page, instead of showing a login prompt. Is this what you are looking for?

+1
source

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


All Articles