agreeable-butcher-53769
06/03/2024, 3:59 PMchilly-king-10285
06/03/2024, 3:59 PMchilly-king-10285
06/03/2024, 3:59 PM/oauth2/token
endpoint to check the validity of the token. If the token is invalid, the endpoint will return an error message. If you need more information for debugging, you can switch the project to development mode to see the error_debug
field in the response. [source](https://www.ory.sh/docs/hydra/debug#oauth2token-endpoint-fails-for-jwks-based-client) If you're still having issues, you might want to check the implementation of your token introspection function. Here's a sample implementation using the Hydra SDK: javascript import { Configuration, OAuth2Api } from "@ory/client" const ory = new OAuth2Api( new Configuration({ basePath: `https://${process.env.ORY_PROJECT_SLUG}.<http://projects.oryapis.com|projects.oryapis.com>`, accessToken: process.env.ORY_API_KEY, }), ) export async function introspectToken(accessToken: string) { const { data } = await ory.introspectOAuth2Token({ token: accessToken }) data.active // true or false }
[source](https://www.ory.sh/docs/hydra/guides/oauth2-token-introspection)