-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Keycloak: 'State cookie was missing' if user started login in Keycloak and is waiting for 10 minutes or more. #9928
Comments
I've the same problem on my site. On our setup the User doesn't need to wait it always happens (also on immediate login). |
I came across the same problem yesterday. |
Hi everyone, hope my answer will help to everyone. We work with Keycloak. Our config looks like this:
So why I added cookies to config? In this case we do not need to turn off 'checks' in config. We also do redirect from nextauth signin page to our custom signin page with nice design. But from my side here is question to devs of next auth: Why do we use so small lifetime for |
Provider type
Keycloak
Environment
My package.json:
config for next-auth:
Reproduction URL
https://github.com/AliakseiPaseishviliSyntheticabio/test-repo
Describe the issue
Sometime user doing login to our app for too long and in this case we are navigated to sign-in page with next error, instead of giving access to the app.:
![image](https://private-user-images.githubusercontent.com/142044988/302703526-86686bd3-64bd-43d8-af95-924bb9499fef.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg4NTc4ODEsIm5iZiI6MTczODg1NzU4MSwicGF0aCI6Ii8xNDIwNDQ5ODgvMzAyNzAzNTI2LTg2Njg2YmQzLTY0YmQtNDNkOC1hZjk1LTkyNGJiOTQ5OWZlZi5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjA2JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIwNlQxNTU5NDFaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT00YmIxMTUzODE5MmQxN2JmMDRjZjM0NjA4MDkwZGVmNWE0Y2I5ZTMzZTRkNmU1Y2M4NjBkZWZmNjgwMDI3YzNhJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.gWQDoQUhukVzseVKqkZ98bJS2LSknLCBejTsyV1Bpgk)
Pressing on sign in with keycloak will navigate our user to app without any keycloak login pages.
UPD: repo is not here. This is private code and I can't share env details to you.
How to reproduce
Steps to reproduce:
in logs we got error: 'State cookie was missing'.
Expected behavior
It does login without any issues even in 10 or 15 minutes, because default login time in keycloak is set to 30 minutes.
The text was updated successfully, but these errors were encountered: