#4026·hydra

Add Janitor removing expired tokens by client_secret_expires_at

Author: astudnevCreated Sep 12, 2025Updated Sep 13, 2026
Labelsfeatstale

Preflight checklist

Ory Network Project

No response

Describe your problem

In docs for Janitor https://www.ory.sh/docs/hydra/cli/hydra-janitor have not find a solution to how to cleanup all expired access tokens from Hydra?

If access token is bound to client with client_secret_expires_at then it will correctly return not authorized request for this token

However there is no way to delete these tokens that are expired, from database

Describe your ideal solution

Add a flag to janitor -use-expires-at that uses this filed to find and delete expired tokens

Workarounds or alternatives

we have to write no SQL ourselves

Version

2.X.X

Additional Context

No response