loud-keyboard-84117
06/09/2022, 10:43 AMaccess_token
issued by hydra, it works with postman but when I try to do this using hydraAdmin
's
await hydraAdmin
.introspectOAuth2Token(tokenParsed)
.then((res) => {
console.log("res: ", res.data)
// var result = JSON.parse(res);
callback(res.data);
})
.catch((err) => {
console.error(err);
callback(null);
});
or
await <http://request.post|request.post>(
{
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'Content-Length': body.length
},
url: constants.base_auth_url + '/oauth2/introspect',
body
},
function (error, response, body) {
if (!error && response.statusCode >= 200 && response.statusCode < 300) {
var result = JSON.parse(body);
console.log("res: ", result)
callback(result);
} else {
console.log(response);
console.log(body);
console.log(error);
callback(null);
}
}
)
What I'm trying to achieve here is, having a lambda authorizer which checks for user on every request.
Every request returns {active: false}
when I do it on lambda but works fine with postman.
Can anyone help me out with this, please?magnificent-energy-493
magnificent-energy-493