gifted-salesmen-20057
12/08/2023, 5:53 AMchilly-king-10285
12/08/2023, 5:53 AMchilly-king-10285
12/08/2023, 5:53 AMbash ory patch oauth2-config {project.id} \ --replace "/ttl/access_token=\"2h\"" \ --format yaml
In addition to this, you can also modify the access token lifespan for each grant type individually per client using the SDK. Here's an example of how to do it: 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 setClientLifespans(clientId: string) { await ory.setOAuth2ClientLifespans({ id: clientId, oAuth2ClientTokenLifespans: { authorization_code_grant_access_token_lifespan: "1h", client_credentials_grant_access_token_lifespan: "1h", implicit_grant_access_token_lifespan: "1h", jwt_bearer_grant_access_token_lifespan: "1h", refresh_token_grant_access_token_lifespan: "1h", }, }) }
For more details, you can refer to the [Ory documentation](https://www.ory.sh/docs/hydra/guides/client-token-expiration).