Windows身份验证在Elastic Beanstalk中不起作用

时间:2017-12-15 14:22:48

标签: asp.net amazon-web-services iis elastic-beanstalk

我有一个使用Windows身份验证的ASP .net Web应用程序。该页面显示登录的人员用户名(Controller.User.Identity.Name),并在web.config中有<authentication mode="Windows" />。该页面在当前服务器和我的本地计算机上正常工作。但是当我将它部署到beanstalk服务器时,页面不会提示输入凭据。

以下是我到目前为止所做的步骤。 我发现我必须在EBS IIS服务器中启用Windows身份验证。 使用以下命令

添加了AWS Elastic Beanstalk配置文件(.ebxtensions)
commands:
 01-install-windows-auth:
command: powershell.exe -ExecutionPolicy RemoteSigned "Add-WindowsFeature Web-Security,Web-Windows-Auth"
ignoreErrors: true
waitAfterCompletion: 5
 02-enable-iis-windows-auth:
command: powershell.exe -ExecutionPolicy RemoteSigned "Set-WebConfigurationProperty -Filter '/system.webServer/security/authentication/windowsAuthentication' -Name Enabled -Value True -PSPath 'IIS:\' -Location 'Default Web Site'"
ignoreErrors: true
waitAfterCompletion: 5

我的EB环境中的日志文件:

2017-12-15 10:27:02,152 INFO 1 AWSBeanstalkCfnDeploy.DeploymentUtils - Updating file (Default Web Site/Auth.aspx).
2017-12-15 10:27:02,152 INFO 1 DeploymentLog - Updating file (Default Web Site/Auth.aspx).
2017-12-15 10:27:02,152 INFO 1 AWSBeanstalkCfnDeploy.DeploymentUtils - Updating file (Default Web Site/bin\AuthAWS.dll).
2017-12-15 10:27:02,152 INFO 1 DeploymentLog - Updating file (Default Web Site/bin\AuthAWS.dll).
2017-12-15 10:27:02,152 INFO 1 AWSBeanstalkCfnDeploy.DeploymentUtils - Updating file (Default Web Site/bin\AuthAWS.pdb).
2017-12-15 10:27:02,152 INFO 1 DeploymentLog - Updating file (Default Web Site/bin\AuthAWS.pdb).
2017-12-15 10:27:02,168 INFO 1 AWSBeanstalkCfnDeploy.DeploymentUtils - Updating file (Default Web Site/Web.config).
2017-12-15 10:27:02,168 INFO 1 DeploymentLog - Updating file (Default Web Site/Web.config).
2017-12-15 10:27:02,168 INFO 1 AWSBeanstalkCfnDeploy.DeploymentUtils - Adding ACL's for path (Default Web Site/)
2017-12-15 10:27:02,168 INFO 1 DeploymentLog - Adding ACL's for path (Default Web Site/)
2017-12-15 10:27:02,183 INFO 1 AWSBeanstalkCfnDeploy.DeploymentUtils - Adding ACL's for path (Default Web Site/)
2017-12-15 10:27:02,183 INFO 1 DeploymentLog - Adding ACL's for path (Default Web Site/)

 2017-12-15 13:51:00,910 [INFO] Command 01-install-windows-auth succeeded
 2017-12-15 13:51:00,910 [INFO] Waiting 5 seconds for reboot
 2017-12-15 13:51:06,487 [INFO] Command 02-enable-iis-windows-auth succeeded
 2017-12-15 13:51:06,487 [INFO] Waiting 5 seconds for reboot
 2017-12-15 13:51:11,519 [INFO] Running configSet Hook-PreAppDeploy
 2017-12-15 13:51:11,519 [INFO] Running config Hook-PreAppDeploy
 2017-12-15 13:51:13,410 [INFO] Command hooks succeeded
 2017-12-15 13:51:13,440 [INFO] Running configSet Infra-EmbeddedPostBuild
 2017-12-15 13:51:13,440 [INFO] Running configSet Hook-EnactAppDeploy
 2017-12-15 13:51:13,457 [INFO] Running config Hook-EnactAppDeploy
 2017-12-15 13:51:17,237 [INFO] Command hooks succeeded
 2017-12-15 13:51:17,253 [INFO] Running configSet Hook-PostAppDeploy
 2017-12-15 13:51:17,269 [INFO] Running config Hook-PostAppDeploy
 2017-12-15 13:51:21,769 [INFO] Command hooks succeeded
 2017-12-15 13:51:21,783 [INFO] ConfigSets completed

我猜认证已成功添加到已添加的内容中。我重新启动了我的EBS实例,没有任何反应。它仍然不会要求登录时进行任何身份验证。

我在google上搜索过,这一切都指向.ebextensions的创建,以便在EBS环境中配置IIS。我错过了什么吗?我只需要在我的应用程序上启用Windows身份验证。任何想法?

0 个答案:

没有答案