サイトで使用されている SSL 証明書を使用してセッション Cookie を暗号化し、IIS アプリケーション プールを実行するユーザーにその証明書の秘密キーへのアクセスを許可することをお勧めします。
前者は次の方法で実現できます。
まず、Application Start イベントで、onServiceConfigurationCreated イベントをフックします。
void Application_Start(object sender, EventArgs e)
{
// Code that runs on application startup
FederatedAuthentication.ServiceConfigurationCreated += OnServiceConfigurationCreated;
}
次に、次の実装を使用します。
void OnServiceConfigurationCreated(object sender, ServiceConfigurationCreatedEventArgs e)
{
//
// Use the <serviceCertificate> to protect the cookies that are
// sent to the client.
//
if (e.ServiceConfiguration.ServiceCertificate != null)
{
List<CookieTransform> sessionTransforms =
new List<CookieTransform>(new CookieTransform[] {
new DeflateCookieTransform(),
new RsaEncryptionCookieTransform(e.ServiceConfiguration.ServiceCertificate),
new RsaSignatureCookieTransform(e.ServiceConfiguration.ServiceCertificate) });
SessionSecurityTokenHandler sessionHandler =
new SessionSecurityTokenHandler(sessionTransforms.AsReadOnly());
e.ServiceConfiguration.SecurityTokenHandlers.AddOrReplace(sessionHandler);
}
microsoft.identityModel セクション内の Certificates セクションにその証明書を追加する必要があります。
<serviceCertificate>
<certificateReference x509FindType="FindByThumbprint" findValue="[cert_thumbprint]" />
</serviceCertificate>
最後に、その証明書の秘密鍵へのアクセスをアプリケーション プールを実行するユーザーに許可するには、次を使用します。
winhttpcertcfg -g -a "AppPool アカウント" -c LOCAL_MACHINE\My -s www.mysite.com
ここで、winhttpcertcfgはここからダウンロードするツールです。LOCAL_MACHINE\Myは証明書ストアの名前で、SSL 証明書が配置されています。" www.mysite.com " は、SSL 証明書のサブジェクト (CN) 名です。
これで問題が解決すると思います。そうでない場合は、結果とともにここに戻ってきてください。