Skip to content
Snippets Groups Projects
Commit fc43b890 authored by Lloyd Hilaiel's avatar Lloyd Hilaiel
Browse files

better error/debug messages upon audience mismatch in verifier

parent ae4bc23d
No related branches found
No related tags found
Loading
......@@ -156,14 +156,17 @@ function verify(assertion, audience, successCB, errorCB, pkRetriever) {
if (!principal.email.match("@" + theIssuer + "$"))
return errorCB();
}
var tok = new jwt.JWT();
tok.parse(bundle.assertion);
// audience must match!
if (tok.audience != audience)
return errorCB();
if (tok.audience != audience) {
logger.debug("verification failure, audience mismatch: '"
+ tok.audience + "' != '" + audience + "'");
return errorCB("audience mismatch");
}
if (tok.verify(pk)) {
successCB(principal.email, tok.audience, tok.expires, theIssuer);
} else {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment