<@U04UQ68083H> how to change expiration time for s...
# ory-copilot
b
@chilly-king-10285 how to change expiration time for self-service login flows in ory network
c
A message from kapa.ai
You can modify the expiration time for self-service login flows in Ory Network using the Ory CLI. By default, the user session lasts for 1 hour. However, you can modify this value using the following command:
Copy code
bash ory patch oauth2-config --project <project-id> --workspace <workspace-id> \   --replace "/ttl/login_consent_request=\"2h\"" \   --format yaml
In this command, replace
<project-id>
and
<workspace-id>
with your project and workspace IDs, respectively. The
"/ttl/login_consent_request=\"2h\""
part sets the new expiration time for the login and consent request to 2 hours. You can adjust this value to meet your needs. For more details, please refer to the [Ory documentation](https://www.ory.sh/docs/hydra/guides/client-token-expiration#login-and-consent-flow).
b
@chilly-king-10285 how to get the current
Copy code
login_consent_request
c
A message from kapa.ai
To get the current
login_consent_request
, you need to use the Ory Hydra API's
getOAuth2ConsentRequest
method. This method is used to fetch information about a consent request. The consent challenge is used as a parameter to fetch this information. Here is the endpoint you would use:
Copy code
GET /admin/oauth2/auth/requests/consent
You need to provide the
consent_challenge
as a query parameter. This challenge is used to identify the session. For more details, please refer to the [Ory API documentation](https://www.ory.sh/docs/reference/api#operation/getOAuth2ConsentRequest).