keyfetch.js-ARCHIVED/keyfetch-test.js

25 lines
588 B
JavaScript
Raw Normal View History

2019-02-25 22:54:08 +00:00
'use strict';
var keyfetch = require('./keyfetch.js');
2019-02-25 23:17:26 +00:00
var testUrl = "https://example.auth0.com";
2019-02-25 22:54:08 +00:00
keyfetch.init({});
2019-02-25 23:17:26 +00:00
keyfetch.oidcJwks().then(function (jwks) {
keyfetch._clear();
2019-02-25 22:54:08 +00:00
console.log(jwks);
2019-02-25 23:17:26 +00:00
return keyfetch.oidcJwk(jwks[0].thumbprint, "https://example.auth0.com").then(function () {
return keyfetch.oidcJwk(jwks[0].thumbprint, "https://example.auth0.com").then(function (jwk) {
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);
});
*/