"unknown, invalid, or expired refresh token","error":"invalid_grant - Can Apache handle multiple requests from one client in a short time? #586
Replies: 2 comments 1 reply
-
I believe that is a problem indeed: when the Authorization Server uses rolling refresh tokens and there's 2 parallel requests coming in from the same client that both decide the access token needs to be refreshed, only one can/will win. It is hard to protect 100% against this in code though I will think more about pushing down the odds a bit. For the time being, a potential workaround is to have the server not issue a new refresh token on each token request or to try and avoid having the client issue parallel refresh requests. |
Beta Was this translation helpful? Give feedback.
-
a mitigation for this issue is now in place in https://github.com/OpenIDC/mod_auth_openidc/releases/tag/v2.4.15.3 |
Beta Was this translation helpful? Give feedback.
-
Hi,
I've configured my Apache instance as an RP to connect to an existing OP. Below are my Apache configurations.
An Angular client uses Apache to retrieve the access token every 29 minutes. The Angular client uses the access token to access REST services in the backend. In general it's working. But from time to time (maybe evey 3-4 hours) I get an 401 from the backend.
I found out that Apache does not refresh the access token in that case:
The access token stays the same. I also found some errors in the log
Update: it seems like I get an invalid access token if one client sends two or more request in a very short time (ms) to Apache.
Configuration:
Logs:
From my Angular application I call Apache with the following link to retrieve the access token
const userInfoUrl = '/auth?info=json';
also tried
const tokenRefreshUrl = '/auth?info=json&access_token_refresh_interval=60';
and
const tokenRefreshUrl = '/auth?info=json&access_token_refresh_interval=0';
Apache Version: 2.4.47
Beta Was this translation helpful? Give feedback.
All reactions