Longer oauth expiry date #1007
Replies: 3 comments 3 replies
|
wdym ? what issue do you face ? |
|
my oauth session expires daily so its really annoying when my ai agent opened few tabs trying to refresh the token that I have to close manually. I prefer api tokens as it dont expire. |
|
Fixed in 4.0.0 — and @jubnl's read of it was right, it was the race, not the lifetime. For the record on the lifetime, since that was the original ask: access tokens already last an hour and refresh tokens roll for thirty days. Nothing there was expiring daily. What was happening is that refresh rotation is a race by construction. Several MCP sessions share one refresh token, two of them post it within the same second, and the loser was read as a replayed token: the whole chain got revoked, sessions were torn down, and you got a login window. Repeat daily. A revoked refresh token now only counts as a replay once it is more than 30 seconds past the rotation that revoked it, and only when that rotation left a live successor behind. Inside the window the second caller simply gets its own token pair. Theft is still caught — a stolen token used later, or after the chain was already killed, is refused exactly as before — and an explicit logout is not re-opened by the window either. This is the leeway RFC 9700 §4.14.2 asks for. If you want to avoid refresh tokens entirely for an unattended agent, machine clients (client credentials) are still the better fit: no refresh token, no rotation at all. |

Uh oh!
There was an error while loading. Please reload this page.
Please allow for longer oauth expiry date.
All reactions