-
Hey everyone, I'm trying to use the It seems like Redis is only using the access token's expiration time for the entire session entry. This causes the Redis key to expire when the short-lived access token does, which defeats the purpose of having a long-lived refresh token. ConfigurationHere's my basic setup in quarkus.oidc.credentials.jwt.key-id=jwtToken
# OIDC Provider (Google)
quarkus.oidc.auth-server-url=https://accounts.google.com
quarkus.oidc.client-id=YOUR_GOOGLE_CLIENT_ID.apps.googleusercontent.com
quarkus.oidc.credentials.secret=YOUR_GOOGLE_CLIENT_SECRET
quarkus.oidc-client.client-enabled=false
quarkus.oidc-client.grant.type=refresh
quarkus.oidc.authentication.extra-params.access_type=offline
quarkus.oidc.token.refresh-expired=true
quarkus.oidc.authentication.extra-params.prompt=consent
# Token State Manager Configuration
quarkus.redis.hosts=redis://localhost.com:17497
quarkus.redis.password=xxxxxxxxxxxxxx
quarkus.redis.max-pool-size=4 The ProblemMy understanding is that this extension should create a session entry in Redis that holds the ID, access, and refresh tokens. When the access token expires, Quarkus should be able to use the stored refresh token to get a new one from Google automatically. However, the entire Redis entry for the session seems to have a This forces the user to log in again, which is exactly what I'm trying to avoid. My QuestionHas anyone successfully configured this extension, particularly with Google as the provider?
Any working examples or insights would be greatly appreciated. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 8 replies
-
/cc @Ladicek (redis), @cescoffier (redis), @machi1990 (redis), @pedroigor (oidc), @sberyozkin (oidc) |
Beta Was this translation helpful? Give feedback.
-
@Jaland thanks, I'll have a closer look next week, but it is definitely not the AT ttl that is used for a redis entry. The TTL of this entry must be equal to the session's cookie max age which is a sum of the ID token ttl plus an optional session extension param, so it can be as large as needed. You are also mixing in the |
Beta Was this translation helpful? Give feedback.
-
Also CC Michal @michalvavrik |
Beta Was this translation helpful? Give feedback.
-
@Jaland Can you check if the RT expiry is even returned by Google? I'm pretty sure it is a binary token. I think your best try could be to extend the session max age with the quarkus oidc session extension property, for it to be equal to the rt ttl, to make sure that even if the user is idle and returns when the id token has already expired, the valid rt is still there to refresh tokens. |
Beta Was this translation helpful? Give feedback.
Hey y'all,
So it was
quarkus.oidc.authentication.session-age-extension
that I was missing. I know it defaults to 5 minutes but my client just showed it as1h
. Once I bumped it up to like 20000 and increased the TTL inside my Redis Cache to 6 hours.Thanks for all the help late on a Friday