JWT-OTP
Simple Javascript Web Tokens using OTPs for signatures.
Getting Started
Install the package npm install --save jwt-otp
Basic Usage:
var TokenAgent = ; // Create an agent to manage your seed secretsvar sessionAgent = ; // Set a seed secret to issue tokens withsessionAgent // Create a token using an arbitrary payload var myToken = sessionAgent // Validate/Read the tokensessionAgent;
Advance Usage:
var TokenAgent = ; // Create an agent to manage your seed secretsvar sessionAgent = ; // Set a seed secret to issue tokens withsessionAgent // Create a token using an arbitrary payload var myToken = sessionAgent // Swap the keys outvar oldSeed = sessionAgentissuingSeed sessionAgent // Add the old seed to the valid seeds and let it expireoldSeedexpireAt = + 10000sessionAgent // Validate/Read the token that we created before we swaped the keyssessionAgent;