Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Web application to use window domain accounts for authentication

If you have a web application that will run inside a network, it makes sense for it to support windows authentication (active directory?).

Would it make sense to use AD security model as well, or would I make my own roles/security module that some admin would have to configure for each user?

I've never dealt with windows security before, so I am very confused as to how I should be handling security for a web application that runs within a windows network.

I guess there are 2 major points I have to tackle:

1. authentication
2. authorization

I have a feeling that best-practice would say to handle authorization myself, but use AD authentication right?

like image 687
Blankman Avatar asked Dec 11 '08 20:12

Blankman


People also ask

What option do we use in web config to enable Windows Authentication for the web application?

Select File >> New >> select ASP.NET Core Web Application, and change the authentication to Windows Authentication. We can also configure the existing application for Windows Authentication by selecting the option of WA. To configure the authentication manually, open Visual Studio project properties >> go to Debug tab.

How do I use Windows Authentication on Chrome?

Click on 'Security tab > Local intranet' then the 'Custom level...' button. Scroll to the bottom and select the 'Automatic logon with current user name and password' option. It's under the 'Authentication > Logon' section. Click OK to save the changes.


2 Answers

Basically windows handles everything, you never store usernames or passwords, AD and IIS do all the work for you

add this to your web.config

 <system.web>
  ...
  <authentication mode="Windows"/>
  ...
 </system.web>

To configure Windows authentication

  1. Start Internet Information Services (IIS).
  2. Right-click your application's virtual directory, and then click Properties.
  3. Click the Directory Security tab.
  4. Under Anonymous access and authentication control, click Edit.
  5. Make sure the Anonymous access check box is not selected and that Integrated Windows authentication is the only selected check box.

You can then deal with the business or authorization using web.config again. for example

<authorization>
 <deny users="DomainName\UserName" />
 <allow roles="DomainName\WindowsGroup" />
</authorization>

Read more here: http://msdn.microsoft.com/en-us/library/ms998358.aspx

like image 151
Ian G Avatar answered Oct 06 '22 01:10

Ian G


This problem is solved in detail by Mr. Scott Guthrie in Link 1 and Link 2

like image 43
Perpetualcoder Avatar answered Oct 05 '22 23:10

Perpetualcoder