我想我们的.NET应用程序的Web.config中的“system.web.membership”元素进行加密,以确保用户名和密码到Active Directory。 我使用ASPNET_REGIIS命令进行加密,并曾尝试没有成功的“PE”选项的值几个不同的字符串。 我已经成功地加密在我的web.config中的“connectstrings”元素。
CMD
C:\Windows\Microsoft.NET\Framework\v2.0.50727>aspnet_regiis -pe "connectionStrings" -site MySite -app /MyApp Encrypting configuration section... Succeeded! C:\Windows\Microsoft.NET\Framework\v2.0.50727>aspnet_regiis -pe "membership" -site MySite -app /MyApp Encrypting configuration section... The configuration section 'membership' was not found. Failed! C:\Windows\Microsoft.NET\Framework\v2.0.50727>aspnet_regiis -pe "system.web.membership" -site MySite -app /MyApp Encrypting configuration section... The configuration section 'system.web.membership' was not found. Failed!
Web.Config中
<configuration>
...
<system.web>
...
<authentication mode="Forms">
<forms name=".ADAuthCookie"
timeout="30"/>
</authentication>
<authorization>
<deny users="?"/>
<allow users="*"/>
</authorization>
<membership defaultProvider="MyADMembershipProvider">
<providers>
<add name="MyADMembershipProvider"
type="System.Web.Security.ActiveDirectoryMembershipProvider, System.Web, Version=2.0.0.0,Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
connectionStringName="ADConnectionString"
connectionUsername="MyUserName"
connectionPassword="MyPassowrd"/>
</providers>
</membership>
...
</system.web>
...
</configuration>
那么是什么原因? 我在想什么?