首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >间歇性Azure AD B2C异常: IDX10614: AsymmetricSecurityKey.GetSignatureFormater()引发异常

间歇性Azure AD B2C异常: IDX10614: AsymmetricSecurityKey.GetSignatureFormater()引发异常
EN

Stack Overflow用户
提问于 2020-10-24 05:29:58
回答 1查看 280关注 0票数 2

我们使用AAD B2C和自定义策略已经有一段时间了,一切都正常工作,但突然之间,我们开始在登录策略上遇到例外。更糟糕的是,有时它确实有效,但5次中有4次我们得到了异常。

我们通过将策略链接到Application Insights来挖掘错误,下面是我们得到的结果:

代码语言:javascript
运行
复制
"Kind": "FatalException",
    "Content": {
      "Time": "9:05 PM",
      "Exception": {
        "Kind": "Handled",
        "HResult": "80131509",
        "Message": "IDX10614: AsymmetricSecurityKey.GetSignatureFormater( 'http://www.w3.org/2001/04/xmldsig-more#rsa-sha256' ) threw an exception.\nKey: 'System.IdentityModel.Tokens.X509AsymmetricSecurityKey'\nSignatureAlgorithm: 'http://www.w3.org/2001/04/xmldsig-more#rsa-sha256', check to make sure the SignatureAlgorithm is supported.\nException:'System.Security.Cryptography.CryptographicException: Invalid provider type specified.\r\n\r\n   at System.Security.Cryptography.Utils.CreateProvHandle(CspParameters parameters, Boolean randomKeyContainer)\r\n   at System.Security.Cryptography.Utils.GetKeyPairHelper(CspAlgorithmType keyType, CspParameters parameters, Boolean randomKeyContainer, Int32 dwKeySize, SafeProvHandle& safeProvHandle, SafeKeyHandle& safeKeyHandle)\r\n   at System.Security.Cryptography.RSACryptoServiceProvider.GetKeyPair()\r\n   at System.Security.Cryptography.RSACryptoServiceProvider..ctor(Int32 dwKeySize, CspParameters parameters, Boolean useDefaultKeySize)\r\n   at System.Security.Cryptography.X509Certificates.X509Certificate2.get_PrivateKey()\r\n   at System.IdentityModel.Tokens.X509AsymmetricSecurityKey.get_PrivateKey()\r\n   at System.IdentityModel.Tokens.X509AsymmetricSecurityKey.GetSignatureFormatter(String algorithm)\r\n   at System.IdentityModel.Tokens.AsymmetricSignatureProvider..ctor(AsymmetricSecurityKey key, String algorithm, Boolean willCreateSignatures)'.\nIf you only need to verify signatures the parameter 'willBeUseForSigning' should be false if the private key is not be available.",
        "Data": {},
        "Exception": {
          "Kind": "Handled",
          "HResult": "80090014",
          "Message": "Invalid provider type specified.\r\n",
          "Data": {}
        }
      }
    }

我不确定发生了什么变化,也不知道这是如何突然开始发生的。我们是否使用隐名模式并不重要。

此外,微软方面也没有停机报告。

任何线索都将不胜感激!

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-10-25 04:52:24

已通过此处找到的信息解决:StackOverflow question

因为我们也在使用Invite Flow,所以我使用了上面提到的New-SelfSignedCertificate命令。

现在,我已经使用此Microsoft doc中的信息并附加来自上面那个StackOverflow线程的Provider参数重新生成了证书:

代码语言:javascript
运行
复制
PS C:\WINDOWS\system32> New-SelfSignedCertificate `
>>     -KeyExportPolicy Exportable `
>>     -Subject "CN=***.onmicrosoft.com" `
>>     -KeyAlgorithm RSA `
>>     -KeyLength 2048 `
>>     -KeyUsage DigitalSignature `
>>     -NotAfter (Get-Date).AddMonths(24) `
>>     -CertStoreLocation "Cert:\CurrentUser\My" `
>>     -Provider "microsoft enhanced rsa and aes cryptographic provider"

虽然我不确定为什么这个突然停止了,但我猜可能是微软更新了他们那端的一些东西。

不管怎样,它现在似乎起作用了,所以让我们看看吧。

票数 4
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/64507542

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档