Hey Guys, I am trying to increase access_token dur...
# talk-hydra
a
Hey Guys, I am trying to increase access_token duration from
config.yaml
file. I have changed the value from 1hr to 72hr but still it's not changing after building. and also I am little confused with how to use refresh token to get new access_token. any ideas ? Thanks 🙂
c
Hello. How did you install hydra? Are you using the docker image or docker-compose version? The value you are trying to change in the config file should be in this structure:
Copy code
ttl:
  access_token: 72h
If this still does not work, an alternative way to set this is through the environmental value: _`TTL_ACCESS_TOKEN=72h`_
For the refresh token flow, you can use the API docs as your guide. You essentially need to make a post request to the token endpoint, by providing
Copy code
grant_type=refresh_token
refresh_token=*your_refresh_token*
https://www.ory.sh/docs/reference/api#tag/oAuth2/operation/oauth2TokenExchange
a
Hey @chilly-balloon-35803 I a using docker compose version and the file is -
internal/config/config.yaml
and the the changes -
ttl:
# configures how long a user login and consent flow may take. Defaults to 1h.
login_consent_request: 10h
# configures how long access tokens are valid. Defaults to 1h.
access_token: 10h
# configures how long refresh tokens are valid. Defaults to 720h. Set to -1 for refresh tokens to never expire.
refresh_token: 720h
# configures how long id tokens are valid. Defaults to 1h.
id_token: 10h
# configures how long auth codes are valid. Defaults to 10m.
auth_code: 1h
then I did
sudo docker-compose -f quickstart.yml -f quickstart-postgres.yml up --build -d
Thanks for the support I will try with environment value.
c
Your config looks correct. Make sure to have this part properly configured in your docker compose for both hydra and hydra-migrate containers, so the config file is copied and served in both containers.
a
Thanks, I will try :)
I was able to increase
access_token
duration by adding them to
contrib/quickstart/5-min/hydra.yml
file and
refresh
token flow is also working. Thanks for the support 😃 @chilly-balloon-35803.
c
Glad I could help! 😄