w3tecch / express-typescript-boilerplate

A delightful way to building a RESTful API with NodeJs & TypeScript by @w3tecch
MIT License
3.31k stars 905 forks source link

No Token provided by the client #84

Closed netlander closed 6 years ago

netlander commented 6 years ago

Spent the last few hours tearing whatever little hair I have left trying to access the api/users and api/pets swagger APIs using Postman, tried every combination under the sun, getting the following error. Any thought on how to authenticate to these endpoint?

info: [auth:AuthService] No Token provided by the client
warn: [auth:authorizationChecker] No token given
error: [api:middlewares\ErrorHandlerMiddleware] AuthorizationRequiredError 0=Error
    at AuthorizationRequiredError.HttpError [as constructor] (G:\src\web\portal-development\boilerplate\express-typescript-boilerplate-develop\src\http-error\HttpError.ts:19:22)
    at AuthorizationRequiredError.UnauthorizedError [as constructor] (G:\src\web\portal-development\boilerplate\express-typescript-boilerplate-develop\src\http-error\UnauthorizedError.ts:10:9)
    at new AuthorizationRequiredError (G:\src\web\portal-development\boilerplate\express-typescript-boilerplate-develop\src\error\AuthorizationRequiredError.ts:12:9)
    at handleError_1 (G:\src\web\portal-development\boilerplate\express-typescript-boilerplate-develop\src\driver\express\ExpressDriver.ts:111:87)
    at G:\src\web\portal-development\boilerplate\express-typescript-boilerplate-develop\src\driver\express\ExpressDriver.ts:120:45
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:160:7)
netlander commented 6 years ago

Got it sorted using auth0-mock-server to get a token, then using oAuth2 authentication scheme in Postman and pasting the obtained token into Access Token field.