mysterious-florist-5498
06/10/2023, 4:21 PMaccessTokenA:refreshTokenA
• request B: use accessTokenA:refreshTokenA
• request C: use accessTokenA:refreshTokenA
• request D: use accessTokenA:refreshTokenA
A, B, C call /oauth2/token
with refreshTokenA
to refresh token:
B and C log error "debug":"Unable to serialize access due to a concurrent update in another session: The request could not be completed due to concurrent access", "message":"invalid_request", "reason":"Failed to refresh token because of multiple concurrent requests using the same token which is not allowed.", "msg":"access denied
A is the only one able to refresh the token and got accessTokenB:refreshTokenB
On my software, I am handling the case when B & C are failing, to retrieve the token refreshed by A
A, B and C call /oauth2/introspect
with the new token accessTokenB
and they got a response 200
with body Introspection{Active:true, Subject:"mysubject"}
Everything is fine for A, B an C
Now D is late and it is calling /oauth2/token
with refreshTokenA
to refresh token:
D got a different error: "debug":"token_inactive", "message":"token_inactive", "reason":"Token validation failed.", "msg":"access denied"
Because D failed, like B & C, I am able to search and retrieve the token generate by request A accessTokenB
D is now calling /oauth2/introspect
with the new token accessTokenB
and it got a response 200
with body Introspection{Active:false, Subject:""}
On Hydra side, the log is "debug":"not_found","message":"request_unauthorized","reason":"Check that you provided valid credentials in the right format.","msg":"access denied"
It seems the last call to /oauth2/token
delete my new token accessTokenB:refreshTokenB
Do you know if this behavior is normal for hydra ?mysterious-florist-5498
06/10/2023, 8:18 PM// Reference: <https://tools.ietf.org/html/rfc6819#section-5.2.2.3>
//
// The basic idea is to change the refresh token
// value with every refresh request in order to detect attempts to
// obtain access tokens using old refresh tokens. Since the
// authorization server cannot determine whether the attacker or the
// legitimate client is trying to access, in case of such an access
// attempt the valid refresh token and the access authorization
// associated with it are both revoked.
mysterious-florist-5498
06/10/2023, 8:25 PMicy-manchester-83109
06/11/2023, 10:07 AMmysterious-florist-5498
06/11/2023, 12:03 PM