-
Notifications
You must be signed in to change notification settings - Fork 131
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
Trouble using VaadinSecurity #313
Comments
I'm facing the same problem, did you solve it? |
Hi Alvaro, fortunately I found a workaround which differs from the docs. I switched on Spring auto configuration for security and configured spring-security for allowed anonymous access to my application. With this configuration Spring seems to link the HTTP session with a SecurityContext. Hope that helps, |
Yep it helped me a bit tbh, but I found out that my problem was a bit different but also found a fix for it, thanks for the help. |
@AlvaroFalcon How did you fix this problem? I'm having the same issue, but no clue how to solve it.. Switching views is no Problem, but reloading. I do also have a INFO log entry like this: |
I have the same issue. I am using the keycloak spring adapter. When enabling Vaadin Push everything works, except security is somehow ignored. I also see the warning: |
Have you tried something like this in your UI class?: @Override
protected void init(VaadinRequest vaadinRequest) {
// ...
if (vaadinSecurity.isAuthenticated()) {
setContent(adminView);
removeStyleName("loginView");
getNavigator().navigateTo(getNavigator().getState());
} else {
setContent(loginView);
addStyleName("loginView");
}
} |
Hi everybody,
currently I face some trouble using managed VaadinSecurity.
My setup:
My application has several views which are managed by the Vaadin Navigator. One view is the admin-view for which a login is needed.
I followed the sample application for managed security and I'm able to log-in. But when I switch to another view and back to the admin view, I have to re-login even if the HTTP Session was not closed.
I supposed some implementation error in the vaadin-spring-ext-security, so I created a simple custom service which sets the SecurityContext. This service was tried in @VaadinSessionScope and in singleton scope but it behaved like the vaadin-spring-ext-security and lost the user context after switching the view.
Maybe my issue is related to https://stackoverflow.com/questions/33541022/vaadin-springboot-integration-and-securitycontextholder-getcontext-is-null? Any thoughts?
Cheers,
Christoph
The text was updated successfully, but these errors were encountered: