我目前使用这个样本作为我的测试床。 IdentityServer3.Samples/source/MembershipReboot/IIS 10 System.Security.Cryptography.CryptographicException:访问被拒绝
我已经分配了正确的权限并阅读了关于此问题的其他几篇文章,但仍然拒绝访问。
我的IIS应用程序运行在applicationpoolidentity下。
我目前使用这个样本作为我的测试床。 IdentityServer3.Samples/source/MembershipReboot/IIS 10 System.Security.Cryptography.CryptographicException:访问被拒绝
我已经分配了正确的权限并阅读了关于此问题的其他几篇文章,但仍然拒绝访问。
我的IIS应用程序运行在applicationpoolidentity下。
好的。让我们专注于解决方案。
首先,我从代码中添加了证书到用户密钥集,而不是机器密钥文件夹。
var certificate = new X509Certificate2(objApiCertficate.CertificateData,this.strApiPassword,X509KeyStorageFlags.UserKeySet); certHandler.ClientCertificates.Add(certificate);
然后,您必须在应用程序池中加载用户配置文件。 请在测试之前重新启动IIS。
我上传了一些截图在我的博客上。
https://guntucomputerhacks.blogspot.com.au/2017/08/systemsecuritycryptographycryptographic.html