Token-Auth is a Token-based Authentication system. It generates token and stores them in local storage with user informations. It verifies provided token from HTTP Header (Authorization) in order to allow access to protected end point api.
Get the sources:
git clone https://github.com/Gulshan-gaur/User_AUTH_NODEJS.git
In order to start the nodejs server, we need express and node_modules dependencies.
Install the nodejs dependencies:
home$ npm install
Start the server:
home$ node index.js
home$ curl http://localhost:3001/signin
This send back the generated token for later usage.
home$ curl --header 'Authorization: AUTH Generated_Token' http://localhost:3001/protected
home$ curl --header 'Authorization: AUTH Generated_Token' http://localhost:3001/expire
- Node.js
- Passport