botframework-sdk icon indicating copy to clipboard operation
botframework-sdk copied to clipboard

Invalid token. System.IdentityModel.Tokens.SecurityTokenSignatureKeyNotFoundException: IDX10500

Open dhirajgupta1 opened this issue 10 years ago • 4 comments

Hello,

I just created a BOT and published on azure. I registered it and when tested it is saying Endpoint authorization succeeded.

When tested in Emulator i got 500 Internal server error.

When looked into Azure logging i found this issue

PID[6092] Warning Invalid token. System.IdentityModel.Tokens.SecurityTokenSignatureKeyNotFoundException: IDX10500: Signature validation failed. Unable to resolve SecurityKeyIdentifier: 'SecurityKeyIdentifier ( IsReadOnly = False, Count = 2, Clause[0] = X509ThumbprintKeyIdentifierClause(Hash = 0x61B44041161C13F9A8B56549287AF02C16DDFFDB), Clause[1] = System.IdentityModel.Tokens.NamedKeySecurityKeyIdentifierClause ) ', token: '{"typ":"JWT","alg":"RS256","x5t":"YbRAQRYcE_motWVJKHrwLBbd_9s","kid":"YbRAQRYcE_motWVJKHrwLBbd_9s"}.{"aud":"https://graph.microsoft.com","iss":"https://sts.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47/","iat":1474272436,"nbf":1474272436,"exp":1474276336,"app_displayname":"Nagarro Speech BOT","appid":"2787376c-41c9-43e2-8fe8- 2d7cd011db47/","iat":1474272436,"nbf":1474272436,"exp":1474276336,"app_displayname":"Nagarro Speech BOT","appid":"2787376c-41c9-43e2-8fe8-b1688aff17d5","appidacr":"1","idp":"https://sts.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47/","tid":"72f988bf-86f1-41af-91ab-2d7cd011db47","ver":"1.0"}'. at System.IdentityModel.Tokens.JwtSecurityTokenHandler.ValidateSignature(String token, TokenValidationParameters validationParameters) at System.IdentityModel.Tokens.JwtSecurityTokenHandler.ValidateToken(String securityToken, TokenValidationParameters validationParameters, SecurityToken& validatedToken) at Microsoft.Bot.Connector.JwtTokenExtractor.d__9.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.Bot.Connector.JwtTokenExtractor.d__6.MoveNext()

please help me in fixing this issue.

Thanks, Dhiraj

dhirajgupta1 avatar Sep 19 '16 09:09 dhirajgupta1

Hi @dhirajgupta1, it looks like your bot was not able to connect to the login.microsoftonline.com server to download the list of acceptable signing keys.

If you restart the bot, does it work? That will help us identify that this is the error.

dandriscoll avatar Sep 19 '16 20:09 dandriscoll

Yes i am still getting issue but this is different from previous one, i used Speech API in this bot.

HTTP Error 500.0 - Internal Server Error

The page cannot be displayed because an internal server error has occurred.

Most likely causes:

  • IIS received the request; however, an internal error occurred during the processing of the request. The root cause of this error depends on which module handles the request and what was happening in the worker process when this error occurred.
  • IIS was not able to access the web.config file for the Web site or application. This can occur if the NTFS permissions are set incorrectly.
  • IIS was not able to process configuration for the Web site or application.
  • The authenticated user does not have permission to use this DLL.
  • The request is mapped to a managed handler but the .NET Extensibility Feature is not installed.

Things you can try:

  • Ensure that the NTFS permissions for the web.config file are correct and allow access to the Web server's machine account.
  • Check the event logs to see if any additional information was logged.
  • Verify the permissions for the DLL.
  • Install the .NET Extensibility feature if the request is mapped to a managed handler.
  • Create a tracing rule to track failed requests for this HTTP status code. For more information about creating a tracing rule for failed requests, click here.

Detailed Error Information:

Module   ManagedPipelineHandler
Notification   ExecuteRequestHandler
Handler   System.Web.Http.WebHost.HttpControllerHandler
Error Code   0x00000000
Requested URL   https://SpeechBotApplication20160919012618:80/api/messages
Physical Path   D:\home\site\wwwroot\api\messages
Logon Method   Anonymous
Logon User   Anonymous

More Information:

This error means that there was a problem while processing the request. The request was received by the Web server, but during processing a fatal error occurred, causing the 500 error.

View more information »

Microsoft Knowledge Base Articles:

dhirajgupta1 avatar Sep 20 '16 08:09 dhirajgupta1

Hello @dhirajgupta1, you'll need to get the exception detail to determine what's failing. Can you gather that information and reply if the failure isn't clear?

dandriscoll avatar Sep 20 '16 14:09 dandriscoll

closing due to inactivity

tomlm avatar Nov 05 '16 17:11 tomlm