Set Refresh Token TTL in SPI

We have a Service Provider Interface that provides a custom login UI. If the user checks a “Keep me logged in” checkbox, we’d like the SPI to have Keycloak generate a refresh token with its TTL set to 120 days. Otherwise, the TTL should be one hour. I can’t find anything in the documentation.

Can we do this with Keycloak? Is there a better way to implement “Keep me logged in”?