1
This commit is contained in:
parent
dfe375f24d
commit
5e589fb896
@ -11,10 +11,10 @@ function asyncVerify(jwksUri, data) {
|
||||
err: null,
|
||||
decoded: null
|
||||
};
|
||||
const client = jwksClient({
|
||||
jwksUri: jwksUri
|
||||
});
|
||||
function getKey(header, cb ) {
|
||||
const client = jwksClient({
|
||||
jwksUri: jwksUri
|
||||
});
|
||||
console.log(header);
|
||||
client.getSigningKey(header.kid, function(err, key) {
|
||||
console.log(err);
|
||||
@ -41,15 +41,15 @@ function asyncVerify(jwksUri, data) {
|
||||
|
||||
async function verify(session) {
|
||||
const postData = session.getBody();
|
||||
console.log(postData);
|
||||
const jwksUri = postData['jwksUri'];
|
||||
const arr = postData['data'].split('.');
|
||||
const header = base64url.decode(arr[0]);
|
||||
const payload = base64url.decode(arr[1]);
|
||||
const sign = base64url.decode(arr[2]);
|
||||
//const arr = postData['data'].split('.');
|
||||
//const header = base64url.decode(arr[0]);
|
||||
//const payload = base64url.decode(arr[1]);
|
||||
//const sign = base64url.decode(arr[2]);
|
||||
const {err, decoded} = await asyncVerify(jwksUri, postData['data']);
|
||||
console.log(err, decoded);
|
||||
if (err != null) {
|
||||
//console.log(postData);
|
||||
session.rspErr(500, err);
|
||||
return;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user