Coggle requires JavaScript to display documents.
getSecret = secretOrPublicKey;
getSecret = (header, secretCallback) => secretCallback(null, secretOrPublicKey);
(err, data) => data
(header, secretCallback) => secretCallback(error, secretOrPublicKey)
valid = jws.verify(jwtString, decodedToken.header.alg, secretOrPublicKey);
payload = decodedToken.payload;
{ header, payload, signature }
const decoded = jwt.verify( token, 'secretKey', { algorithms: ['RS256', 'RS512'] }, (err, payload) => {...} )
payload, secretOrPrivateKey, callback
payload, secretOrPrivateKey, options, callback
payload, secretOrPrivateKey
jwt.sign({ foo: 'bar', }, 'secretKey', { algorithm: 'RS256', expiresIn: 60*60, notBefore: '7d', audience: '...', issuer: '...', jwtid: '...' subject: '..', noTimestamp: false, keyid: '..', mutatePayload: '..' }, (err, token) => console.log(token))