auth0-blog / nodejs-jwt-authentication-sample

A NodeJS API that supports username and password authentication with JWTs
MIT License
688 stars 267 forks source link

jwt issuer invalid. expected: https://login.microsoftonline.com/******/v2.0 #34

Closed ardabeyazoglu closed 6 years ago

ardabeyazoglu commented 6 years ago

Hi,

When I tried to run nodejs-sso example, everything works fine until const {jwt} = auth.verifyJWT(req, {scp: 'access_as_user'}); throws the error jwt issuer invalid. expected: https://login.microsoftonline.com/*****/v2.0. When I checked the expected url and the issuer i placed in the code, they are exactly the same. However, when i decode jwt token i see that iss claim is different than this.

Why do i get a jwt token with a different iss claim ?

NOTE: The iss claim in the decoded token is "https://login.microsoftonline.com/a2b0309e-37c1-486d-bdbd-4d91b7d25cd5/v2.0".