2019-02-25 22:54:08 +00:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
var keyfetch = require('./keyfetch.js');
|
2019-03-09 09:50:14 +00:00
|
|
|
var testIss = "https://example.auth0.com";
|
2019-02-25 22:54:08 +00:00
|
|
|
|
|
|
|
keyfetch.init({});
|
2019-03-09 09:50:14 +00:00
|
|
|
keyfetch.oidcJwks(testIss).then(function (hits) {
|
2019-02-25 23:17:26 +00:00
|
|
|
keyfetch._clear();
|
2019-03-09 09:50:14 +00:00
|
|
|
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);
|
|
|
|
});
|
|
|
|
*/
|