Skip to content

yassirrchi/spring-mvc-thymeleaf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pagination / Search / Deletion

1

Connecting Mysql to the project (+mysql dependency check pom.xml)

2

get a json as a response

3

form validators using Spring Boot Starter Validation

validator

Adding a new patient

add

Editing a patient

update

Login in as a user with basic privileges

user

Login in as an admin with admin privileges

admin

Users and their roles

1

-i used the first method (commented code) which is the inMemoryAuth and the second method which is jdbc using the same database (mysql patint_db) that we've used before. -i changed controllers path from raw to /admin/example and /user/example to manage roles easily in configure(HttpSecurity http)

2

we created 3 more tables to authenticate users with jdbc

4

i filled these tables with

4

5

6

7

in this part we are moving from jdbc verification to UserDetails

2

3

and then, inserting another user for testing nammed "yassirrchi" identified by 1234 as a password with admin/user privileges, to the genrated table app_users that we've seen previously

1

4

now lets try our app with UserDetails

VID-20220427-174115

"yassirrchi" doesnt have ADMIN's role nor USER, cause there is a difference between roles and authorities in spring-security now lets try fixing this issue by making some changes in SecurityConfig.java

VID-20220427-174317 (1)

(hasRole to hasAuthority) -lets try once again

VID-20220427-174628 why "yassirrchi" is having only USER privileges even though he's an admin? cause our user doesnt respect the conditions that we've set while working with thymeleaf templates

VID-20220427-175352

so after changing the condition from hasRole to hasAuthority, lets try again yassirrchi (admin) and anwar (regular user)

VID-20220427-175648

finally our app is up and running 🙌

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published