Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

User signed out when calling silent renew #176

Open
nomttr opened this issue Sep 4, 2020 · 1 comment
Open

User signed out when calling silent renew #176

nomttr opened this issue Sep 4, 2020 · 1 comment

Comments

@nomttr
Copy link

nomttr commented Sep 4, 2020

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
image

Redux actions
image

Network
image

@Jaganprafful
Copy link

Jaganprafful commented Sep 9, 2020

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.
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants