Comments (5)
This project doesn't work. Good idea but, it doesn't work
from express-typescript-boilerplate.
Hi @sinner
Please have a look at authorizationChecker.ts in auth for validating the token.
from express-typescript-boilerplate.
Hi @dweber019!
Thank you very much for your response.
It's difficult to know that, moreover, I think there will be a list of URLs enable to manage a JWT connection (sign-up, sign-in, logout, refresh-token...).
Do I need to put this logic inside the authorizationChecker.ts file or it's already there?
from express-typescript-boilerplate.
Hi @sinner
We mostly use Auth0 or an other authorisation party which will provide the JWT management urls.
The authorizationChecker.ts
is only for checking that a token is provided and valid. So it's like a hook and is no opinionated.
If you use the @Authorized
decorator, then the authorizationChecker.ts
is used to check if the user is authorised => has a valid token.
See here for usage of @Authorized
: https://github.com/w3tecch/express-typescript-boilerplate/blob/develop/src/api/controllers/PetController.ts#L7
If you like to have management urls like provisioning a token for user you have to implement that by your self. I would suggest you use passportjs. Here a good example how to implement jwt with a node app: https://scotch.io/tutorials/authenticate-a-node-js-api-with-json-web-tokens
According to the tutorial you would also create a route like authenticate
and check the token in the authorizationChecker.ts
with jwt.verify(token, ...
.
from express-typescript-boilerplate.
@sinner Sorry to hear that.
Our goal is to be not opinionated on authentication. Additionally we use this boilerplate in a more mature architecture, where the authentication is done by a other system. This is because of SSO, audit trails and a lot of other security reasons.
from express-typescript-boilerplate.
Related Issues (20)
- Docker build fails HOT 2
- Seeding out of date
- File upload using multer integration
- Errors when installing on Ubuntu 18 LTS HOT 2
- How can i integrate JWT Authentication in this boiler plate HOT 1
- How can i integrate JWT Authentication in this boiler plate HOT 2
- Error when installing (bcrypt) HOT 1
- Error connecting to PostgreSQL with SSL
- error while yarn run setup command HOT 5
- Integrate with Relative Path
- How to set Elastic search Loader?
- About public route without authentication
- Update version of bcrypt and sqlite3 to 5.0.1 and 5.0.0 respectively HOT 8
- How to use winston?
- Why use CommonJS?
- 'yarn start serve' does not start the server HOT 1
- Bcrypt installation errors on M1 Mac HOT 4
- docker not started nps not found
- Cannot create migrations
- Witch branch Should I use ?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from express-typescript-boilerplate.