Skip to main content

Posts

Showing posts with the label Spring Security

How to use Authentication and Authorization in Spring Security | Role based Authorization

Role based Authorization (Admin and Other User) and Permissions in Spring Security with Spring Boot In this article, we will see how we can achieve Authentication using inMemoryAuthentication and role based Authorization in Spring Security. We perform Authentication and Authorization with Spring Boot application that we already seen in older articles. First Refer below articles related Spring Boot CRUD operation with Rest API and Thymeleaf. Spring Boot CRUD (Create, Read, Update, Delete) operation with Rest API, JPA and MySql  Spring Boot Crud Operation with Thymeleaf, MySql, JPA and Rest API   For enable security in spring, first we have to add below dependency in pom.xml file. Step 1 : Add spring-security dependency in pom.xml file <dependency>      <groupId>org.springframework.boot</groupId>      <artifactId>spring-boot-starter-security</artifactId> </dependency> Step 2 : Create new Java class and extends wit...