redux-oidc
redux-oidc copied to clipboard
User signed out when calling silent renew
Hey,
I'm was trying to learn a bit about OIDC and React with Redux. I've set up Keycloak, downloaded redux-oidc-example, updated userManagerConfig and configured it to work with Authorization Code Flow.
I run the application, successfully log in by using my IP(Azure AD), it navigates me back to the app, the app is able to get my profile from the access token, but then...after literally few seconds it signs me out. I hit again Login button and the same thing happens.
So I started to dig into this and it seems that the issues is with automatic silent renew - anytime the code goes through the defined silent_redirect_uri page user is automatically signed out. I've checked Keycloak configuration and userManagerConfig but I do not see any mistakes there. What's even more interesting - this issue occurs only on Chrome(I'm using v. 85.0.4183.83) - on Edge/Firefox/Chrome Dev everything works properly.
I have seen that a lot of people have had the same issue and the solution for that was to disable automaticSilentRenew in userManagerConfig but that's not solution for me as I want to have this enabled.
Any ideas why is this happening?
const userManagerConfig = {
authority:
"https://blablabla/auth/realms/master/",
client_id: "PGPlatform.Gateway",
redirect_uri: `${window.location.protocol}//${window.location.hostname}${
window.location.port ? `:${window.location.port}` : ""
}/callback`,
response_type: "code",
scope: "openid profile api",
silent_redirect_uri: `${window.location.protocol}//${
window.location.hostname
}${window.location.port ? `:${window.location.port}` : ""}/silent_renew.html`,
automaticSilentRenew: true,
filterProtocolClaims: true,
loadUserInfo: true,
};
Keycloak Token config
Redux actions
Network
Even I faced a similar issue after logging in it automatically logging off in incognito mode chrome but it is working fine in non-incognito mode, I think its due to block third-party cookies flag enabled as below after some research disabling flag resolved my issue.