Skip to content

Lifespan (ttl) at consent #3522

Answered by vinckr
kotyara85 asked this question in Q&A
May 20, 2023 · 1 comments · 2 replies
Discussion options

You must be logged in to vote

Hello @kotyara85
Sorry for the late reply!

Yes, it is possible to dynamically set the expiration time of tokens in Ory Hydra, overwriting the default per token configuration. This can be done for various tokens including access tokens, ID tokens, auth codes, and refresh tokens.
For global configuration in Ory Network, you can use the Ory CLI to set the lifespan of the access token and refresh token. Here are the commands:

# Set access token lifespan to two hours globally
ory patch oauth2-config {project.id} \  
 --replace "/ttl/access_token=\"2h\"" \  
 --format yaml  

# Set refresh token lifespan to one day globally
ory patch oauth2-config {project.id} \  
 --replace "/ttl/refresh_token…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@kotyara85
Comment options

@vinckr
Comment options

Answer selected by vinckr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants