<@U04UQ68083H> when executing oauth request, how l...
# ory-copilot
i
@chilly-king-10285 when executing oauth request, how long is a login / consent challenge valid? or can I configure somewhere how long it is valid?
b
A message from kapa.ai
Based on the knowledge sources provided, I can answer your question about the validity duration of login/consent challenges in Ory OAuth2 and how to configure it. By default, the login and consent flow in Ory lasts for 1 hour. However, you can modify this value using the Ory CLI. Here's how you can configure the duration:
Copy code
ory patch oauth2-config --project <project-id> --workspace <workspace-id> \     --replace "/ttl/login_consent_request=\"2h\"" \     --format yaml
In this example, the duration is set to 2 hours. You can adjust the value as needed, using time units like "m" for minutes or "h" for hours [Configure token expiration time](https://www.ory.sh/docs/hydra/guides/client-token-expiration). It's important to note that this configuration sets how long the user has to submit login credentials and consent during the OAuth2 flow. After this period expires, a new login/consent challenge would need to be initiated. Remember that this is different from the expiration times of other tokens like access tokens, refresh tokens, or ID tokens, which have their own separate configurations.