This is a Java-based web application implementing a simple user authentication system using servlets. It provides basic functionalities for user registration, login, and session management.
- User Registration: Allows users to create new accounts with a unique username and a securely hashed password.
- User Login: Provides authentication using stored credentials, granting access upon successful login.
- Session Management: Maintains user sessions for authenticated users.
- Java Servlets
- MySQL Database
- BCrypt for password hashing
src/
- Contains the Java servlets and backend logic.webapp/
- Includes HTML, CSS, and frontend resources.database/
- SQL scripts for database setup and schema.
-
Database Configuration:
- Create a MySQL database and execute the provided SQL scripts (
database/setup.sql
). - Update
DB_URL
,DB_USER
, andDB_PASSWORD
in the servlets accordingly.
- Create a MySQL database and execute the provided SQL scripts (
-
Project Setup:
- Clone the repository.
- Import the project into your preferred Java IDE.
-
Run the Application:
- Deploy the project on a servlet container (e.g., Apache Tomcat).
- Access the application via the browser at
http://localhost:8080/UserAuth
.
- Access the login and registration functionality via the respective HTML pages.
- Test the user authentication flow by registering a new user and then logging in.
Contributions are welcome! Feel free to open issues or submit pull requests with improvements or additional features.