Skip to content

Question about token refreshing in concurrent requests #248

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mkohns opened this issue Mar 2, 2019 · 2 comments
Closed

Question about token refreshing in concurrent requests #248

mkohns opened this issue Mar 2, 2019 · 2 comments

Comments

@mkohns
Copy link

mkohns commented Mar 2, 2019

Hi, I am new to lua-resty-openidc and have started analysing the main flows.
I have build up the following scenario for testing.

-> keycloak (token ttl = 5min)
-> secured angular app with 4 components, all refreshing their content every minute via REST calls
-> redis as storage backend to better analyse session/cookie function

My question:

-> After auth at keycloak, lua-resty-openidc created one session with one cookie with all configured content (token, refresh ..). Perfect.
-> Subsequent calls of the angular app get bearer injected as long as "token expired" is false. Perfect.
-> After 5 min (see above keycloak configured token ttl) 4 almost parallel requests arrive at nginx with expired tokens (okay, to be clear: they arrive with the same cookie, which reflects the expired token).
-> All 4 calls go into refresh token mode, initiate 4 refresh token calls at keycloak and iterate persistence over 4 new cookies in redis.

Is this the expected behaviour or am I missing important configuration options?
I actually assumed that the "session lock" I see in redis - should (or could) be used to overcome this resource consuming situation.

What are your thoughts?

Thanks!

@zandbelt
Copy link
Contributor

zandbelt commented Mar 3, 2019

see: #190

@zandbelt
Copy link
Contributor

any other question about that or can we close this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants