开发者

Help with SAML error: "Keyset does not exist"

We have two environments that should be identical but one of them raises an error when we try to generate a SAML message signature. I haven't looked at SAML before and I am not exactly sure what it tries to do

Part of the code:

X509Certificat开发者_Python百科e2 x509Certificate = (X509Certificate2)Application[ASP.global_asax.IdPX509Certificate];

        try
        {
            SAMLMessageSignature.Generate(samlResponse, x509Certificate.PrivateKey, x509Certificate);
        }
        catch (Exception ex)
        {
            app = File.AppendText(@"C:\SAML.txt");
            app.WriteLine(ex.Message.ToString());
            app.Flush();
            app.Close();
        }

The exception message is

Keyset does not exist

Does anyone have any idea of what I should be looking at?

Thanks in advance.


Hi please check the following on your setup.

  • Set the correct access control entries, ACLs, to the certificate you installed.
  • Add Modify access role for NETWORK SERVICE to the certificate.
  • If you are using Windows 2008 and Windows 7, you can access the private key from the certificate snap-in in the MMC.

    Help with SAML error: "Keyset does not exist"

  • If it still did not work, add Modify access role also for IIS_IUSRS.

    Help with SAML error: "Keyset does not exist"

Hope it will help you.

Thank you!


Check to see if the certificate stored in the HttpApplicationState object's key ASP.global_asax.IdPX509Certificate was loaded successfully. If the certificate is being loaded from a PFX file, ensure that it is present on the disk and accessible by the account your web app is running under. If the certificate is being loaded from a certificate store, ensure that it is installed in the correct store and that the account your web app is running under can access the certificate.

You can use winhttpcertcfg.exe to install certificates into system keystores and manage certificate ACLs. The KB article http://support.microsoft.com/kb/901183 contains some additional info.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜