Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting up Windows Authentication for web application #411

Open
MahesRam opened this issue Jan 9, 2018 · 2 comments
Open

Setting up Windows Authentication for web application #411

MahesRam opened this issue Jan 9, 2018 · 2 comments

Comments

@MahesRam
Copy link

MahesRam commented Jan 9, 2018

Cookbook version

iis (6.8.0)

Chef-client version

13.6.4

Platform Details

Windows 2008 R2

Scenario:

Setting up Windows Authentication for web application

Steps to Reproduce:

iis_site 'MySiteName' do
protocol :http
#port 80 Default port is 80
path "D:\Folder\Path"
action [:add,:start]
end

Expected Result:

How do I enable windows authentication and disable anonymous auth?

Actual Result:

I did not find any doc. This is a feature request.

@EasyAsABC123
Copy link
Contributor

looks like currently it has to be done via

# Set IUSR username and password authentication
iis_config "\"MyWebsite/aSite\" -section:system.webServer/security/authentication/anonymousAuthentication /enabled:\"True\" /userName:\"IUSR_foobar\" /password:\"p@assword\" /commit:apphost" do
  action :set
end

which isn't idempotent...

this is the best windows doc i can find

appcmd.exe set config "Contoso" -section:system.webServer/security/authentication/anonymousAuthentication /enabled:"False" /commit:apphost

appcmd.exe set config "Contoso" -section:system.webServer/security/authentication/windowsAuthentication /enabled:"True" /commit:apphost

so it looks like it is on the apphost, which makes me not sure if you can commit it to a specific site only

@rarrarrarr
Copy link

The following works for me. Give it a shot!

iis_config_property "disable anonymous auth" do
  ps_path   "IIS:\\"
  filter    "/system.WebServer/security/authentication/anonymousAuthentication"
  location  "<site name here>"
  property  "Enabled"
  value     "False"    
  action    :set
end

iis_config_property "enable windows auth" do
  ps_path   "IIS:\\"
  filter    "/system.WebServer/security/authentication/windowsAuthentication"
  location  "<site name here>"
  property  "Enabled"
  value     "True"    
  action    :set
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants