-
FEATURED COMPONENTS
First time here? Check out the FAQ!
In my project we use spring security for user authentication. It was made as said in ZKDeveloper'sReference/Integration/Security/Spring_Security + added small to provide ability press enter in for login even form is not in focus.
document.addEventListener("keydown", submitFormOnKeydown, false); function submitFormOnKeydown(e) { var keyCode = e.keyCode; if(keyCode==13) { document.getElementById("loginForm").submit(); } }
The main problem is if I open login page and then restart. After that switch back in a browser by alt+tab, wait till the server starts and then press ENTER this will send a request to the authentification server but the authorization will fail because login page will be reloaded. Does ZK provide some id for clients? Is this possible that this happens because ZK does recognize user and reinit all inner js state?
P.S. Also this happens if open page and left it inactive for 20-30 min.
Is your problem related in any way to your added script? Does it only happen when pressing ENTER? or also when using the form "normally"? (From my perspective it shouldn't make a difference, how the form is submitted). So please remove irrelevant information allowing to focus on the actual problem. If the problem is actually related to pressing ENTER then you should check what your code does differently than the default form implementation.
Anyway I found this similar problem describing the effect you mention without any ZK involved. So for now it sounds like it is the default behavior of spring security to redirect to the login page after a session timeout (a server restart has the same effect, unless you serialize/deserialize the session between restarts).
If that's the case ZK is not involved at all and the request is already bounced back from the Spring security filter chain. This behavior should also happen with JSP/JFS/other front-end technologies, when applying the same Spring Security configuration.
In this case you'll have a better chance for a response by asking for help in a Spring Security forum.
Can you please verify the behavior also happens without involving ZK.
Asked: 2020-02-08 01:44:08 +0800
Seen: 9 times
Last updated: Feb 10 '20
Fix auEngine mixed with POST and GET methods.
ZK Calendar Wire Spring-managed Beans Failed [closed]
Spring security doesn't return user inside event listener
where to put @Transactional (Hibernate Spring)
Clustered Session Terracotta not working
Can't inject using @Value in ViewModel if not declaring as @Component.. so what do we use?
Not able to bind Spring beans after zk upgrade
retriving Spring authentication provider Name dynamically in multiple authentication providers