Posts

Showing posts from March, 2022

Spring Security - Java JWT

Image
 JWT - JWT token consists of these 3 values AUTHENTICATION : check the identity i.e validation [user is valid or not ] AUTHORIZATION : check weather the user is authorized to access the resource which he is demanding. Steps for creating spring security project: - resourse . java brains youtube channel 1. add dependency : spring web ,spring security 2.create SelfUserdetailservice class which will be extending UserDetailsService class from spring security.core library.    In This class we will override methods of UserDetailsService such as  loadUserByUserName....So now this method will return the user  which will also come from spring security library of User type having username, password ,roles list . So we can also create seperate class extending User class or we can directly return the user from this loadUserByUsername method.   3. Create security configuration class which extends WebSecurityConfigurerAdapter class and annotated with @EnableWebSecurit...

Durgesh - Exam Portal Project using Spring Boot and Angular

Image
 > Flow : Have to start from here 🔴Coding Login at Backend using JWT Authentication Spring Security | Spring Security | Examportal #13 Issues faced :  1. Infinite recursive json was recieved while posting user data to database. https://stackoverflow.com/questions/30892298/infinite-loop-with-spring-boot-in-a-one-to-many-relation 2.  You can annotate with @Service  an implementation  and autowire the interface. Spring will check for any object implementing this interface.