Skip to content

Package used to create and verify JWT(JSON Web Token) that allows for verification of claims on resources also known as authorization. Used in the backend to create and verify the JWT, allowing access to required information from the database.

License

Notifications You must be signed in to change notification settings

DaveSharma-Hub/JWT-Creator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JWT-Creator

Description

Package used to create and verify JWT(JSON Web Token) that allows for verification of claims on resources also known as authorization. Used in the backend to create and verify the JWT, allowing access to required information from the database.

Installation

npm i @nuclear-packages/jwt-creator

From: https://www.npmjs.com/package/@nuclear-packages/jwt-creator

Usage

const JWT = require('@nuclear-packages');

const jwt = JWT.createJWTSHA256({
    "name":"john",
    "role":"admin"
},"coifodnfn1");

const verify = JWT.verifyJWTSHA256(jwt,"coifodnn1");

Documentation

createJWTSHA256() function requires a payload in the form of a JSON object containing information such as the name, username, email, resource role, etc, and a secret code that could be the hashed password (salted hashed passwords work). Returns the jwt string as header.payload.signature with added information, encoded in base64url and hashed using SHA-256 algorithm

verifyJWTSHA256() function requires a jwt token as a string, and the secret code that could be the hashed password (salted hashed passwords work), and will verify if the token is valid or not.

Contributing

Pull requests are welcome for any changes. For major changes, first open an issue and then contribute

License

MIT

About

Package used to create and verify JWT(JSON Web Token) that allows for verification of claims on resources also known as authorization. Used in the backend to create and verify the JWT, allowing access to required information from the database.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published