Hey Everyone, I've been trying to introspect `acce...
# talk-hydra
l
Hey Everyone, I've been trying to introspect
access_token
issued by hydra, it works with postman but when I try to do this using
hydraAdmin
's
Copy code
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
Copy code
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?
m
you mean Lambda authorizer? I general it should work with it though… How are you running Hydra? Can you provide some more info on your deploy, config and so on? I am not familiar with the lambda authorizer, but you could look into using something like Ory Oathkeeper.
Oh nevermind I saw hackerman answered in a different thread.