I've a filter used for the login. It performs a textual checking, on fields "Username" and "Password". If and only if the textual checking is correctly done the request goes to the Servlet. This latter performs the control that has to interact with the Database. Is this chain correct?
相关问题
- java client program to send digest authentication
- PHP persistent login - Do i reissue a cookie after
- How to handle “App is temporarily blocked from log
- passport.authenticate() using a Promise instead of
- how to create files under /WEB-INF/
相关文章
- java.lang.NoClassDefFoundError: javax/servlet/http
- Forward request from servlet to jsp
- Intercept @RequestHeader exception for missing hea
- User.Identity.IsAuthenticated vs WebSecurity.IsAut
- Integrating Jetty with RESTEasy
- SwiftUI - Vertical Centering Content inside Scroll
- Override UserManager in django
- How to abort Tomcat startup upon exception in Serv
Preface: I gather you're using homegrown login instead of container managed login. For all ways, see How to handle authentication/authorization with users in a database?
The filter (the interceptor) shouldn't check the validity of the username/password combo. That's the responsibility of the servlet (the controller).
The filter should merely check if the user is logged-in or not (usually by just checking the presence of a session attribute) and then continue the request or block it by redirecting back to the login page.
The servlet should collect the submitted data, find the associated
User
in database and if found then store it as a session attribute and then redirect to the home page, else redisplay the form with validation errors.See also: