keyfetch.js/keyfetch-test.js

25 lines
555 B
JavaScript
Raw Normal View History

2019-02-25 22:54:08 +00:00
'use strict';
var keyfetch = require('./keyfetch.js');
var testIss = "https://example.auth0.com";
2019-02-25 22:54:08 +00:00
keyfetch.init({});
keyfetch.oidcJwks(testIss).then(function (hits) {
2019-02-25 23:17:26 +00:00
keyfetch._clear();
console.log(hits);
return keyfetch.oidcJwk(hits[0].thumbprint, testIss).then(function () {
return keyfetch.oidcJwk(hits[0].thumbprint, testIss).then(function (jwk) {
2019-02-25 23:17:26 +00:00
console.log(jwk);
});
2019-02-25 22:54:08 +00:00
});
}).catch(function (err) {
console.error(err);
});
/*
var jwt = '...';
keyfetch.verify({ jwt: jwt }).catch(function (err) {
console.log(err);
});
*/