IIS 7.5: Setting 'app pool user' as the anonymous user programmatically

99封情书 提交于 2019-12-10 14:37:24

问题


I have an web app in IIS 7.5 with its own AppPool using .net 4.

I want to use the feature of having anonymous access as the app pool identity - which is easily configured in a GUI via the inetmgr snapin.

Is there any way do this programmatically, for instance through web.config?

I've looked around and it appears that the anonymousAuthentication element does the trick, but it does not explain how to specify the app pool user in any significant way. I've tried setting my anon user to 'IIS APPPOOL/[AppPoolName]' as seems to be suggested here, with no success.

Any suggestions to how this is supposed to be configured?


回答1:


Taking a closer look at that link: http://www.iis.net/ConfigReference/system.webServer/security/authentication/anonymousAuthentication

'If you leave this value blank (that is, username=""), Anonymous authentication uses the application pool identity to authenticate anonymous users'




回答2:


For the lazy (me)

<system.webServer> <security> <authentication> <anonymousAuthentication userName="" /> </authentication> </security> </system.webServer>



来源:https://stackoverflow.com/questions/3652729/iis-7-5-setting-app-pool-user-as-the-anonymous-user-programmatically

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!