Hi,
I want to make an app logged with an offline token.
const config = {
clientId: "CLIENT", promiseType: "native"
realm: "dev", scope: "offline_access",
url: "https://XXX/auth",
refreshToken: this.getOfflineToken()
}
this.keycloak.init(config).then((authenticated) => {
if (!authenticated) {
this.keycloak.login(config)
}
}).catch((a) => {
console.error(a)
})
this.keycloak.onAuthSuccess = () => {
this.setStorageOfflineToken()
}
- At first login, config.refreshToken is not set, so authenticated = false
- I do login()
- Go back in my app, and authenticated = true !
- At each refresh tokens, offline token is set in localstorage
- At second login, config.refreshToken is an offline refresh token, so authenticated = true !
And, when the active session is finished, I’m disconnected
I test with a short SSO Session Max (2 mins) and I need to re-log with login/password after this 2 mins.
In the admin tab, the offline session is still active.
It looks like this issue https://issues.redhat.com/browse/KEYCLOAK-4201
And in documentation "an offline token will never expire by default and is not subject of the SSO Session Idle timeout
and SSO Session Max lifespan
" https://www.keycloak.org/docs/latest/server_admin/index.html#_offline-access
We can’t have unlimited active session ?
It’s a bug ? Or I misunderstood something?
Thank you for your help.