我使用identityserver4进行SSO问题是每当我重新启动identityserver客户端应用程序时第一次获得异常异常消息
发生了未处理的异常:未处理的远程故障。 (IDX10501:签名验证失败。无法匹配'孩子': ' e57439c26753f8a940888050ab3860fa&#39 ;, 令牌:' {" alg":" RS256","典型":" JWT","孩子&#34 ;:" e57439c26753f8a940888050ab3860fa"} {" NBF":1505114113,"&EXP#34;:1505114413," ISS":" {{ 3}}"" AUD":" empite.rip""随机数":" 636407108987016790.OTIyYzNhOGYtZmY1OS00NDQyLThmNDUtYWNkOTA1NDEyM2JmYTlkYWRjNDMtNDRmMC00YmQxLWI2MGQtOTI2MDYzNDYxMTUy"&# 34; IAT":1505114113," c_hash":" Bc0qZ4ezhn0-WB-e9rDp8g"" SID":" 135b1b1f352674ab3b80846fef6ad0d8",& #34;子":" 94e570f7-920f-426E-b0db-e4f871323149"" auth_time":1505114112," IDP":"本地& #34;" AMR":[" PWD"]}&#39 ;.) System.AggregateException:未处理的远程故障。 (IDX10501: 签名验证失败。无法匹配孩子': ' e57439c26753f8a940888050ab3860fa',令牌: ' {" ALG":" RS256""典型值":" JWT""小子&#34 ;: " e57439c26753f8a940888050ab3860fa"} {" NBF":1505114113,"&EXP#34;:1505114413," ISS":" {{3} }"" AUD":" empite.rip""随机数":" 636407108987016790.OTIyYzNhOGYtZmY1OS00NDQyLThmNDUtYWNkOTA1NDEyM2JmYTlkYWRjNDMtNDRmMC00YmQxLWI2MGQtOTI2MDYzNDYxMTUy"" IAT":1505114113," c_hash":" Bc0qZ4ezhn0-WB-e9rDp8g"" SID":" 135b1b1f352674ab3b80846fef6ad0d8"&#34 ;子":" 94e570f7-920f-426E-b0db-e4f871323149"" auth_time":1505114112," IDP":"本地&#34 ;," AMR":[" PWD"]}&#39 ;.) ---> Microsoft.IdentityModel.Tokens.SecurityTokenSignatureKeyNotFoundException: IDX10501:签名验证失败。无法匹配孩子': ' e57439c26753f8a940888050ab3860fa',令牌: ' {" ALG":" RS256""典型值":" JWT""小子&#34 ;: " e57439c26753f8a940888050ab3860fa"} {" NBF":1505114113,"&EXP#34;:1505114413," ISS":" {{3} }"" AUD":" empite.rip""随机数":" 636407108987016790.OTIyYzNhOGYtZmY1OS00NDQyLThmNDUtYWNkOTA1NDEyM2JmYTlkYWRjNDMtNDRmMC00YmQxLWI2MGQtOTI2MDYzNDYxMTUy"" IAT":1505114113," c_hash":" Bc0qZ4ezhn0-WB-e9rDp8g"" SID":" 135b1b1f352674ab3b80846fef6ad0d8"&#34 ;子":" 94e570f7-920f-426E-b0db-e4f871323149"" auth_time":1505114112," IDP":"本地&#34 ;," AMR":[" PWD"]}&#39 ;. 在 System.IdentityModel.Tokens.Jwt.JwtSecurityTokenHandler.ValidateSignature(字符串 令牌,TokenValidationParameters validationParameters)at System.IdentityModel.Tokens.Jwt.JwtSecurityTokenHandler.ValidateToken(字符串 token,TokenValidationParameters validationParameters,SecurityToken& validatedToken)at Microsoft.AspNetCore.Authentication.OpenIdConnect.OpenIdConnectHandler.ValidateToken(字符串 idToken,AuthenticationProperties属性, TokenValidationParameters validationParameters,JwtSecurityToken& JWT) 在 Microsoft.AspNetCore.Authentication.OpenIdConnect.OpenIdConnectHandler.d__20.MoveNext() ---内部异常堆栈跟踪结束---在Microsoft.AspNetCore.Authentication.RemoteAuthenticationHandler
1.<HandleRemoteCallbackAsync>d__6.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.AspNetCore.Authentication.RemoteAuthenticationHandler
1.d__5.MoveNext() ---从抛出异常的先前位置开始的堆栈跟踪结束--- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(任务 任务)在System.Runtime.CompilerServices.TaskAwaiter1.GetResult() at Microsoft.AspNetCore.Authentication.OpenIdConnect.OpenIdConnectHandler.<HandleRequestAsync>d__15.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware
1.d__18.MoveNext() ---从抛出异常的先前位置开始的堆栈跟踪结束--- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware`1.d__18.MoveNext() ---从抛出异常的先前位置开始的堆栈跟踪结束--- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(任务 任务)
所以我将AddTemporarySigningCredential
更改为AddDeveloperSigningCredential
但是当我重新启动identityserver时仍然会收到错误
如何解决此问题?
答案 0 :(得分:1)
您的问题可能与此有关。查看official docs
在开发过程中,您有时可能会看到一个例外情况 令牌无法验证。这是因为事实 签名密钥材料是在运行中创建的,仅保留在内存中。 客户端和IdentityServer退出时会发生此异常 同步。只需在客户端重复操作,下次即可 元数据已经赶上了,一切都应该恢复正常了。