:wave: Hello, team! I'm trying to introspect the a...
# talk-hydra
c
👋 Hello, team! I'm trying to introspect the accessToken returned from
/oauth2/token
endpoint. I run the following code but not matter what i do it returns
{ active: false }
from ory servers. Following is the code snippet i use.
Copy code
await <http://axios.post|axios.post>(`${oryUrl}/admin/oauth2/introspect`, {
      token: req.headers.authorization.split(' ')[1]
    }, {
      headers: {
        'Authorization': `Bearer ${apiKey}`,
        'Content-Type': 'application/x-www-form-urlencoded'
      }
    }).then(async resp => {
      if (!resp.data.active)
        return res.status(401).send({
          data: null,
          message: 'Access token is not active. Please refresh the token',
          success: false
        })
      
      console.log(resp.data)

      return res.status(201).send({
        ...
      })
    }).catch(ex => {
      ....
    })
Resolved!