Welcome to the Spring Security Lab Work! The goal of this series of tasks is to help you practice and get know to Spring Security, and make an enough startup project. Whether you're a beginner or looking to enhance your skills, these hands-on tasks will guide you through various aspects of security integration in a Spring application.
The primary goal of this lab work is to provide you with practical experience and proficiency in using security within a Spring environment. Spring Security is widely utilized for authentication, authorization and securing your project, and through these tasks, you will gain valuable insights into its configuration, authentication, authorization, and more.
- Task 1: Configure Spring Security
- Task 2: Create a Base Implementation for User
- Task 3: Password Encryption
- Task 4: Add a Dummy Users
- Task 5: Create Identity to Users
- Task 6: Create a Base for Authorization in Server
- Task 7: Authorize Authenticated Users
- Task 8: Authorize by Role
- Task 9: Authorize by Authority
- Task 10: Configure Thymeleaf Security
- Task 11: Authorize Authenticated Users
- Task 12: Authorize by Role
- Task 13: Authorize by Authority
- Task 14: Custom Login Form
Initialize Spring Security in your project.
Define different user roles (Manager, Teacher, Student) and their respective authorities.
Protect endpoints using role-based access control.
Manager Role:
- Add New Teacher (
/teachers/new) - Modify Teacher Profile (
/teachers/{id}/edit) - Modify Student Profile (
/students/{id}/edit) - Modify Student Marks (
/students/{id}/marks/edit)
Teacher Role:
- Modify Student Marks (
/students/{id}/marks/edit) - Add New Subject (
/subjects/new) - Add New Test (
/tests/new)
Student Role:
- Pass Test (
/tests/{id}/take) - Read Marks (
/students/{id}/marks)
Restrict access to UI elements based on user roles.
Ensure that endpoints and UI elements are correctly protected.
