title: Signature validation failed. Unable to match 'kid'
body: <p>i'm using identityserver4  for SSO problem was whenever i restart identityserver client application gets exception for the first time exception message was </p>
  
  <blockquote>
    <p>An unhandled exception has occurred: Unhandled remote failure.
    (IDX10501: Signature validation failed. Unable to match 'kid':
    'e57439c26753f8a940888050ab3860fa',
          token: '{"alg":"RS256","typ":"JWT","kid":"e57439c26753f8a940888050ab3860fa"}.{"nbf":1505114113,"exp":1505114413,"iss":"<a href="http://recruiterinsider-qa.wiseatom.com:85" rel="nofollow noreferrer">http://recruiterinsider-qa.wiseatom.com:85</a>","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 to match 'kid':
    'e57439c26753f8a940888050ab3860fa', token:
    '{"alg":"RS256","typ":"JWT","kid":"e57439c26753f8a940888050ab3860fa"}.{"nbf":1505114113,"exp":1505114413,"iss":"<a href="http://recruiterinsider-qa.wiseatom.com:85" rel="nofollow noreferrer">http://recruiterinsider-qa.wiseatom.com:85</a>","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 to match 'kid':
    'e57439c26753f8a940888050ab3860fa', token:
    '{"alg":"RS256","typ":"JWT","kid":"e57439c26753f8a940888050ab3860fa"}.{"nbf":1505114113,"exp":1505114413,"iss":"<a href="http://recruiterinsider-qa.wiseatom.com:85" rel="nofollow noreferrer">http://recruiterinsider-qa.wiseatom.com:85</a>","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"]}'.
    at
    System.IdentityModel.Tokens.Jwt.JwtSecurityTokenHandler.ValidateSignature(String
    token, TokenValidationParameters validationParameters)    at
    System.IdentityModel.Tokens.Jwt.JwtSecurityTokenHandler.ValidateToken(String
    token, TokenValidationParameters validationParameters, SecurityToken&amp;
    validatedToken)    at
    Microsoft.AspNetCore.Authentication.OpenIdConnect.OpenIdConnectHandler.ValidateToken(String
    idToken, AuthenticationProperties properties,
    TokenValidationParameters validationParameters, JwtSecurityToken&amp; jwt)
    at
    Microsoft.AspNetCore.Authentication.OpenIdConnect.OpenIdConnectHandler.d__20.MoveNext()
    --- End of inner exception stack trace ---    at Microsoft.AspNetCore.Authentication.RemoteAuthenticationHandler<code>1.&lt;HandleRemoteCallbackAsync&gt;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</code>1.d__5.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 System.Runtime.CompilerServices.TaskAwaiter<code>1.GetResult() 
    at
    Microsoft.AspNetCore.Authentication.OpenIdConnect.OpenIdConnectHandler.&lt;HandleRequestAsync&gt;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</code>1.d__18.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---    at
    System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()    at
    Microsoft.AspNetCore.Authentication.AuthenticationMiddleware`1.d__18.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)</p>
  </blockquote>
  
  <p>so i change <code>AddTemporarySigningCredential</code> to <code>AddDeveloperSigningCredential</code> still i'm getting error when ever i restart identityserver </p>
  
  <p>how to fix this issue?</p>