UnauthorizedError: No authorization token was found

I’m working with Ben Dechrai’s great series here:

1 Getting started with Node.js/Express and EJS templating -- Express and Authentication Series - YouTube
2 Add Authentication to Existing Node.js/Express Apps with Auth0 -- Express and Authentication Series - YouTube
3 Protecting Routes and Securing API Endpoints in Node.js/Express -- Express and Authentication Series - YouTube
(and I must say these step by step videos are a life saver, and I hope Auth0 produces more of the same for PHP)

And I have it all working but the last part :>(
The /private page for the API is responding with:

UnauthorizedError: No authorization token was found
at middleware (/home/ubuntu/authapi/node_modules/express-jwt/lib/index.js:79:21)

I placed a console.log('token type and access token : ',token_type, access_token)
under the line
const {token_type, access_token} =req.oidc.accessToken

in the /routes/index.js page and it does show I’m getting a token, so I’m confused!

I also don’t get the extra authorization request for the API on the login page :>(

Obviously I’m a newbie with Auth0 and just a novice with Node, so any suggestions as to further debugging techniques would be great.

Many thanks -

Hey there!

In order to handle that mos effectively I would reach out to Ben via DM on Twitter as he will be the best person to address that:

https://twitter.com/bendechrai