加密的问题在web.config中成员元素 [英] Problem encrypting membership element in web.config

查看:203
本文介绍了加密的问题在web.config中成员元素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想我们的.NET应用程序的Web.config中的system.web.membership元素进行加密,以确保用户名和密码到Active Directory。我使用aspnet_regiis的命令进行加密,并且已经尝试了几种不同的字符串的PE选项,但没有成功的价值。我已经成功地加密connectstrings元素在我的web.config。

I am trying to encrypt the "system.web.membership" element within the Web.Config of our .Net application to secure username and password to Active Directory. I am using the aspnet_regiis command to encrypt, and have tried several different strings for the value of the "pe" option with no success. I have successfully encrypted the "connectstrings" element on my web.config.

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中

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>

那么怎么办?我在想什么?

So what gives? What am I missing?

推荐答案

配置部分标有的System.Web /会员,而不是成员,也不是 system.web.membership

The configuration section is identified by "system.web/membership", not "membership" nor "system.web.membership".

这篇关于加密的问题在web.config中成员元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆