I have created Spring Authorization Server and Spring Cloud Gateway and everything looks perfect, but I found a problem in the gateway and specifically in the flow based on the refresh token. When the user logs in, SAS returns an access token, an oidc token, and a refresh token, which are stored in the SCG memory. The SAS session cookie has a duration of 30 minutes and it is used by SCG to prolong the time of access token. After the cookie expires, SCG starts using the refresh token. Each exchange request also replaces the oidc token in SAS, but SCG does not replace it in its memory. When the user decides to log out, SCG sends the first id_token returned by SAS. For SAS, this token is invalid and throws an exception.
Is there a way to configure the SAS not to refresh the id_token, or to configure the SCG to replace it in memory on a refresh request?