Problem encrypting membership element in web.config

后端 未结 2 728
失恋的感觉
失恋的感觉 2021-01-13 02:13

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 th

相关标签:
2条回答
  • 2021-01-13 02:40

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

    0 讨论(0)
  • 2021-01-13 02:45

    I know that your issue has already been solved, but for other people getting this error message, it seems that only certain sections of the web.config can be encrypted. I was trying to encrypt the SMTP settings in my web config:

    <?xml version="1.0"?>
    <configuration>
      <system.net>
        <mailSettings>
          <smtp>
            <network host="myhost" port="25" userName="myusername" password="mypassword" />
          </smtp>
        </mailSettings>
      </system.net>
    </configuration>
    

    This worked:

    aspnet_regiis.exe -pef "system.net/mailSettings/smtp" "path_to_site" -prov "DataProtectionConfigurationProvider"
    

    but these didn't:

    aspnet_regiis.exe -pef "system.net/mailSettings" "path_to_site" -prov "DataProtectionConfigurationProvider"
    
    aspnet_regiis.exe -pef "system.net" "path_to_site" -prov "DataProtectionConfigurationProvider"
    
    0 讨论(0)
提交回复
热议问题