I am using Keycloak as my identity provider for my React project. On user login, I am getting an access token and a refresh token. When my access token is expired, I will use the refresh token to get a new access token. When the refresh token expiry time is up, I will redirect the user to the login page. Refresh token expiry is 30 minutes.
My issue comes when action refresh token is in its last 3 minutes. The refresh token is not expired and keycloak is returning the status 400. But the token is not expired yet too.
Below is the warning i found in the keycloak server logs.
WARN [org.keycloak.events] (executor-thread-243) type="REFRESH_TOKEN_ERROR", realmId="43ce5723-240d-4ea5-a6c3-4cec38dd3718", clientId="telemedicine-frontend", userId="null", ipAddress="172.16.0.23", error="invalid_token", grant_type="refresh_token", client_auth_method="client-secret"
Anyone have any idea about what is happening here?