-
Notifications
You must be signed in to change notification settings - Fork 94
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
Session lost on window refresh #61
Comments
This is because the example app is configured to use "check-sso" which will not automatically re-authenticate the user after a refresh. For this to work the "silentCheckSsoRedirectUri" attribute needs to be provided
I guess it should be added to the example as well though 🤔 |
I already tried your solution before, but it does'nt work. If you put this config in your There is my init: {
// Use 'login-required' to always require authentication
// If using 'login-required', there is no need for the router guards in router.js
onLoad: "check-sso",
silentCheckSsoRedirectUri: window.location.origin + "/silent-check-sso.html"
} |
Did you also add the "silent-check-sso.html" page to your "public" folder?
As that combined with the silentCheckSsoRedirectUri works for me. However there is some timing issues with the example i see where |
Yes, I had to deal with it waiting for
Yes, I previously added this file, but in Can you confirm that, if you enter in |
Yeah if i remove the router guard functionality that crashes ill get the token info on the secret page after a refresh |
What version of KC Server do you use? 🤔 Edit: I have tried with KC Server v10.0.2 and same error happens. |
We are not using keycloak directly, but redhat-sso. My test was done with the "docker-compose environment" that you get from running |
Oh my f***ing god!! My browser was locking KCServer Cookies!!! 🤦♂️ Now its working like a charm!! Many thanks @baltom ! I will create a PR adding Thanks! |
hehe awesome! 😄 and we appreciate a PR! |
Hi guys,
I found that this lib is working fine if you log in throught keycloak, but if you refresh window (tipically if you are developing the app), it loses the session and have to re-enter keycloak for login.
You can try it in example-app. if you enter
/secret
, you could see token info. But if you press F5, you keep on/secret
page but there is no token. This is because keycloak lib doesn't authenticate the user.I have googled but can't find how to read cookie session and pass it to keycloak lib to authenticate.
The text was updated successfully, but these errors were encountered: