我目前使用這個樣本作爲我的測試牀。 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