Skip to content

Latest commit

 

History

History
64 lines (45 loc) · 3.01 KB

lab-work.md

File metadata and controls

64 lines (45 loc) · 3.01 KB

English | 中文 | Русский

Spring Security Lab Work

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.

Goal of the Lab Work

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.

Practice Tasks

  1. Task 1: Configure Spring Security
  2. Task 2: Create a Base Implementation for User
  3. Task 3: Password Encryption
  4. Task 4: Add a Dummy Users
  5. Task 5: Create Identity to Users
  6. Task 6: Create a Base for Authorization in Server
  7. Task 7: Authorize Authenticated Users
  8. Task 8: Authorize by Role
  9. Task 9: Authorize by Authority
  10. Task 10: Configure Thymeleaf Security
  11. Task 11: Authorize Authenticated Users
  12. Task 12: Authorize by Role
  13. Task 13: Authorize by Authority
  14. Task 14: Custom Login Form

Lab Work Tasks

img.png

Task 1: Setup Spring Security

Initialize Spring Security in your project.

Task 2: Define User Roles and Authorities

Define different user roles (Manager, Teacher, Student) and their respective authorities.

Task 3: Configure Security in Controllers

Protect endpoints using role-based access control.

Implementation Details

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)

Task 4: Implement Authorization in Thymeleaf Templates

Restrict access to UI elements based on user roles.

Task 5: Test Role-Based Access Control

Ensure that endpoints and UI elements are correctly protected.