ms-identity-javascript-angular-tutorial icon indicating copy to clipboard operation
ms-identity-javascript-angular-tutorial copied to clipboard

Help with Error : IDX10503: Signature validation failed. The token's kid is: 'MYKEYID', but did not match any keys in TokenValidationParameters or Configuration. Keys tried

Open JosephHarvey-Xamarin opened this issue 1 year ago • 0 comments

Issue

ms-identity-javascript-angular-tutorial-main\3-Authorization-II\1-call-api

I've followed several of the samples here, but this one was the main one. I am having issues with both my code and this sample. I've either done something wrong, or a configuration in azure is missing.

After following all the steps provided, setuping up the App Registration and the API Registration and adding the required TOKEN/ID's to both the sample and my own app, I get the following error when my app tries to access an "Authorize" protected API in the controller layer.

Microsoft.IdentityModel.LoggingExtensions.IdentityLoggerAdapter: Error: IDX10503: Signature validation failed. The token's kid is: 'MYKEYID', but did not match any keys in TokenValidationParameters or Configuration. Keys tried: 'Microsoft.IdentityModel.Tokens.X509SecurityKey, KeyId: 'SomeKeyid', InternalId: 'SomeKeyid'. , KeyId: SomeKeyid Microsoft.IdentityModel.Tokens.RsaSecurityKey, KeyId: 'SomeKeyid', InternalId: 'SomeKeyid'. , KeyId: SomeKeyid Microsoft.IdentityModel.Tokens.X509SecurityKey, KeyId: 'q-SomeKeyid', InternalId: 'SomeKeyid'. , KeyId: SomeKeyid Microsoft.IdentityModel.Tokens.RsaSecurityKey, KeyId: 'SomeKeyid', InternalId: 'SomeKeyid'. , KeyId: q-23falevZhhD3hm9CQbkP5MQyU Microsoft.IdentityModel.Tokens.X509SecurityKey, KeyId: 'SomeKeyid-zY', InternalId: 'SomeKeyid-zY'. , KeyId: SomeKeyid-zY Microsoft.IdentityModel.Tokens.SomeKeyid, KeyId: 'SomeKeyid-zY', InternalId: 'SomeKeyid'. , KeyId: SomeKeyid-zY '. Number of keys in TokenValidationParameters: '0'. Number of keys in Configuration: '6'. Exceptions caught: ''. token: '[Security Artifact of type 'Microsoft.IdentityModel.JsonWebTokens.JsonWebToken' is hidden. For more details, see https://aka.ms/IdentityModel/SecurityArtifactLogging.]'. See https://aka.ms/IDX10503 for details.

Please provide us with the following information:

This issue is for the sample

    - [ ] 1-1) Sign-in with Azure AD
    - [ ] 1-2) Sign-in with Azure AD B2C
    - [ ] 2-1) Acquire a Token and call Microsoft Graph
    - [X] 3-1) Protect and call a web API on Azure AD
    - [ ] 3-2) Protect and call a web API on Azure AD B2C
    - [ ]   4) Deploy to Azure Storage and App Service
    - [ ] 5-1) Call a web API using App Roles
    - [ ] 5-2) Call a web API using Security Groups
    - [ ] 6-1) Call Microsoft Graph using on-behalf-of flow
    - [ ] 6-2) Call a multi-tenant web API

This issue is for a

    - [ ] bug report -> please search issues before submitting
    - [X] question
    - [ ] feature request
    - [ ] documentation issue or request

Minimal steps to reproduce

N/A

Any log messages given by the failure

see above.

Expected/desired behavior

that it would work

Library version

"@angular/cdk": "^17.1.2",

Browser and version

Chrome & Edge

Mention any other details that might be useful

Thanks! We'll be in touch soon.

JosephHarvey-Xamarin avatar Apr 03 '24 20:04 JosephHarvey-Xamarin