c# - Signature validation failed. Unable to match 'kid' -
i'm using identityserver4 sso problem whenever restart identityserver client application gets exception first time exception message
an unhandled exception has occurred: unhandled remote failure. (idx10501: signature validation failed. unable match 'kid': 'e57439c26753f8a940888050ab3860fa', token: '{"alg":"rs256","typ":"jwt","kid":"e57439c26753f8a940888050ab3860fa"}.{"nbf":1505114113,"exp":1505114413,"iss":"http://recruiterinsider-qa.wiseatom.com:85","aud":"empite.rip","nonce":"636407108987016790.otiyyznhogytzmy1os00ndqylthmndutywnkota1ndeym2jmytlkywrjndmtndrmmc00ymqxlwi2mgqtoti2mdyzndyxmtuy","iat":1505114113,"c_hash":"bc0qz4ezhn0-wb-e9rdp8g","sid":"135b1b1f352674ab3b80846fef6ad0d8","sub":"94e570f7-920f-426e-b0db-e4f871323149","auth_time":1505114112,"idp":"local","amr":["pwd"]}'.) system.aggregateexception: unhandled remote failure. (idx10501: signature validation failed. unable match 'kid': 'e57439c26753f8a940888050ab3860fa', token: '{"alg":"rs256","typ":"jwt","kid":"e57439c26753f8a940888050ab3860fa"}.{"nbf":1505114113,"exp":1505114413,"iss":"http://recruiterinsider-qa.wiseatom.com:85","aud":"empite.rip","nonce":"636407108987016790.otiyyznhogytzmy1os00ndqylthmndutywnkota1ndeym2jmytlkywrjndmtndrmmc00ymqxlwi2mgqtoti2mdyzndyxmtuy","iat":1505114113,"c_hash":"bc0qz4ezhn0-wb-e9rdp8g","sid":"135b1b1f352674ab3b80846fef6ad0d8","sub":"94e570f7-920f-426e-b0db-e4f871323149","auth_time":1505114112,"idp":"local","amr":["pwd"]}'.) ---> microsoft.identitymodel.tokens.securitytokensignaturekeynotfoundexception: idx10501: signature validation failed. unable match 'kid': 'e57439c26753f8a940888050ab3860fa', token: '{"alg":"rs256","typ":"jwt","kid":"e57439c26753f8a940888050ab3860fa"}.{"nbf":1505114113,"exp":1505114413,"iss":"http://recruiterinsider-qa.wiseatom.com:85","aud":"empite.rip","nonce":"636407108987016790.otiyyznhogytzmy1os00ndqylthmndutywnkota1ndeym2jmytlkywrjndmtndrmmc00ymqxlwi2mgqtoti2mdyzndyxmtuy","iat":1505114113,"c_hash":"bc0qz4ezhn0-wb-e9rdp8g","sid":"135b1b1f352674ab3b80846fef6ad0d8","sub":"94e570f7-920f-426e-b0db-e4f871323149","auth_time":1505114112,"idp":"local","amr":["pwd"]}'. @ system.identitymodel.tokens.jwt.jwtsecuritytokenhandler.validatesignature(string token, tokenvalidationparameters validationparameters) @ system.identitymodel.tokens.jwt.jwtsecuritytokenhandler.validatetoken(string token, tokenvalidationparameters validationparameters, securitytoken& validatedtoken) @ microsoft.aspnetcore.authentication.openidconnect.openidconnecthandler.validatetoken(string idtoken, authenticationproperties properties, tokenvalidationparameters validationparameters, jwtsecuritytoken& jwt) @ microsoft.aspnetcore.authentication.openidconnect.openidconnecthandler.d__20.movenext() --- end of inner exception stack trace --- @ microsoft.aspnetcore.authentication.remoteauthenticationhandler
1.<handleremotecallbackasync>d__6.movenext() --- end of stack trace previous location exception thrown --- @ system.runtime.exceptionservices.exceptiondispatchinfo.throw() @ system.runtime.compilerservices.taskawaiter.handlenonsuccessanddebuggernotification(task task) @ microsoft.aspnetcore.authentication.remoteauthenticationhandler
1.d__5.movenext() --- end of stack trace previous location exception thrown --- @ system.runtime.exceptionservices.exceptiondispatchinfo.throw() @ system.runtime.compilerservices.taskawaiter.handlenonsuccessanddebuggernotification(task task) @ system.runtime.compilerservices.taskawaiter1.getresult() @ microsoft.aspnetcore.authentication.openidconnect.openidconnecthandler.<handlerequestasync>d__15.movenext() --- end of stack trace previous location exception thrown --- @ system.runtime.exceptionservices.exceptiondispatchinfo.throw() @ system.runtime.compilerservices.taskawaiter.handlenonsuccessanddebuggernotification(task task) @ microsoft.aspnetcore.authentication.authenticationmiddleware
1.d__18.movenext() --- end of stack trace previous location exception thrown --- @ system.runtime.exceptionservices.exceptiondispatchinfo.throw() @ microsoft.aspnetcore.authentication.authenticationmiddleware`1.d__18.movenext() --- end of stack trace previous location exception thrown --- @ system.runtime.exceptionservices.exceptiondispatchinfo.throw() @ system.runtime.compilerservices.taskawaiter.handlenonsuccessanddebuggernotification(task task)
so change addtemporarysigningcredential
adddevelopersigningcredential
still i'm getting error when ever restart identityserver
how fix issue?
your issue related this. check official docs
during development might see exception stating token not validated. due fact signing key material created on fly , kept in-memory only. exception happens when client , identityserver out of sync. repeat operation @ client, next time metadata has caught up, , should work normal again.
Comments
Post a Comment