문제점이 있습니다 (또는 적어도 생각한 것 같습니다). 나중에 사이트간에 폼 인증 데이터를 공유 할 준비를하기 위해 web.config에 사이트의 컴퓨터 키를 설정하려고합니다. 내가 처음의 Web.config에 다음과 같은 설정 :web.config의 machineKey가 예상대로 작동하지 않음을 나타냅니다.
var machineConfigMachineKey = (MachineKeySection)WebConfigurationManager.OpenMachineConfiguration().SectionGroups["system.web"].Sections["machineKey"];
var webConfigMachineKey = (MachineKeySection)WebConfigurationManager.OpenWebConfiguration("").SectionGroups["system.web"].Sections["machineKey"];
Response.Write("<pre>");
Response.Write("<b>machine.config decrypt: </b>" + machineConfigMachineKey.DecryptionKey + "<br />");
Response.Write("<b>web.config decrypt: </b>" + webConfigMachineKey.DecryptionKey + "<br />");
Response.Write("<br />");
Response.Write("<b>machine.config validate: </b>" + machineConfigMachineKey.ValidationKey + "<br />");
Response.Write("<b>web.config validate: </b>" + webConfigMachineKey.ValidationKey + "<br />");
Response.Write("</pre>");
Response.End();
...에서 어떤 결과 : 시험으로
<machineKey validationKey="<SOME_VALUE>" decryptionKey="<SOME_VALUE>" validation="SHA1" decryption="AES"/>
을, 나는 Web.config의 새로운 machineKey 요소를 테스트하려면 다음을 썼다 이 디스플레이 : 내가 대신 "AutoGenerate를, IsolateApps"의 Web.config의에서 새로운 machineKey 요소에서 사용자 지정 값을 볼 것으로 예상되면서
machine.config decrypt: AutoGenerate,IsolateApps
web.config decrypt: AutoGenerate,IsolateApps
machine.config validate: AutoGenerate,IsolateApps
web.config validate: AutoGenerate,IsolateApps
은 물론 나는이에 의해 매우 혼란 스러워요.
나에게 잔인하게 분명해야하는 여기에 뭔가가 누락 되었습니까?
감사합니다 :)
달콤한! 다음 주에이 프로젝트로 돌아올 때 검토 할 예정입니다. :) – nokturnal