Using Spring Boot 3 With Spring Security Notes
Using Spring Boot 3 With Spring Security Notes
fi
Spring Security 6 with Spring Boot 3
1. Spring Security is a framework that provides authentication, authorization,
and protection against common attacks. With rst class support for securing
both web and reactive applications, it is the de-facto standard for securing Spring-based
applications
• WebSecurityCon gurerAdapte
• EnableGlobalMethodSecurit
• antMatcher
• authorizeRequests
s
fi
y
fi
:
• Creates default user with a username as user and a randomly generated password that is logged
to the console (Ex: 8e557245-73e2-4286-969a-ff57fe326336)
• Spring boot provides properties to cusomize default user’s username and passwor
• Protects the password storage with BCrypt algorith
• Lets the user log out (default logout feature
• CSRF attack prevention (enabled by default
• If Spring Security is on the classpath, Spring Boot automatically secures all HTTP endpoints with
“basic” authentication.
fi
fi
:
Implementing
Basic Authentication using
Spring Security
By Ramesh Fadatare (Java Guides)
Login Request
Client
Securing REST API's with
In memory Authentication
By Ramesh Fadatare (Java Guides)
Create JPA Entities User and
Role ( Many to Many Mapping)
By Ramesh Fadatare (Java Guides)
Creating JPA Repositories
UserRepository and
RoleRepository
By Ramesh Fadatare (Java Guides)
UserDetailsService Interface
Implementation to Load User
from Database
By Ramesh Fadatare (Java Guides)
How Spring Security Database
Authentication Works
By Ramesh Fadatare (Java Guides)
How Database Authentication Works
OAuth2 CustomUserDetailsService
LDAP
DAO
Securing REST API's with
Database Authentication
By Ramesh Fadatare (Java Guides)