A cloud-based identity and access management service for securing user authentication and resource access
How can I validate accessToken on the protected API in NodeJS + Express?
I ctreated a small app using this example https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/samples/msal-node-samples/auth-code-pkce/src/index.ts as a starting point to login and obtain an accessToken from Entra. Everything seems ok, because I receive a valid JWT as expected. Then I created another microservice to expose protected APIs, so I need to implement a JWT validation.
When I try to validate accessToken via jwks-rsa and jsonwebtoken packages I always receive error: "invalid signature".
I don't understand how to fix this issue and how to debug it to understand what is wrong.
Do you have any suggestions?
thanks