Check a token with Bage (RFC 7662)
const url = 'https://api.trybage.com/v1/introspect';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"token":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.trybage.com/v1/introspect \ --header 'Content-Type: application/json' \ --data '{ "token": "example" }'An alternative to checking tokens yourself. Returns active false for a bad, expired or revoked token. It doesn’t check the request signature.
Request Bodyrequired
Section titled “Request Bodyrequired”object
The agent token from the agent-token header.
Example generated
{ "token": "example"}Responses
Section titled “Responses”The answer, with the token’s claims when it’s active.
object
object
The one website this token is for.
The person. The same for the same person every time.
The person’s name.
Only with the email scope.
Only with the email scope.
The agent acting for the person (RFC 8693), and inside it, when the agent runs in a browser platform, the platform.
object
The company that runs the agent.
The platform whose browser the agent runs in.
object
The key requests must be signed with (RFC 7800). The agent’s own, or a session or platform key it bound at sign-in.
object
The key’s JWK thumbprint.
object
Only for agents in test mode.
Example
{ "active": true, "iss": "https://api.trybage.com", "aud": "https://shop.example", "sub": "usr_5b1c9e", "name": "Alex Morgan", "email_verified": true, "act": { "sub": "agt_7a3d1f", "name": "Scout", "operator": "Northwind Labs", "act": { "sub": "agt_9k2m4p", "name": "Kernel" } }, "scope": "browse cart", "test": true, "jti": "tok_8d2e4f"}