Skip to content

sutrisna/expressjs-jsonwebtoken

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

expressjs-jsonwebtoken

Implementasi JWT di Express JS

Install

  • Clone this project:
$ git clone https://github.com/sutrisna/expressjs-jsonwebtoken.git
$ cd expressjs-jsonwebtoken
  • Install NPM dependencies:
$ npm install
  • Running aplikasi:
$ node bin/www

Gunakan rest client seperti postman

Generate Token
route GET: localhost:3000
Verify Token
Tambahkan Authorization di header dan masukan hasil Generate Tokennya
route GET: localhost:3000/validation

Setting expired time

router.get('/', function (req, res) {
  var token = jwt.sign({
    name: 'test',
  },secret , {
    expiresIn: '60000'
  });
  res.send(token);
});

NPM jsonwebtoken by

Auth0

Explore lebih lanjut kunjungi

auth0/node-jsonwebtoken

Sutrisna 1453

Jika tidak bisa sedekah dengan uang, maka bersedekahlah dengan ilmu pengetahuan

About

Implementasi JWT di Express JS

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published