If you are a Java developer, you are expected to have a good understanding of Spring Framework Concepts, specifically in the programming part. Undoubtedly, Spring Boot is the popular framework in the industry. Spring Boot is built on top of Spring Framework itself. If you have a good hold on the Spring Framework, you will easily understand Spring Boot and work on it smoothly. In this article, we will refresh our concepts in the form of MCQs that are frequently asked in the interviews as well. Furthermore, you must also get benefit in the interviews from these Spring MCQ and Answers Explained. So, whether you are a beginner or a professional, solve these Spring MCQs to learn or refresh your concepts
Spring Security
How to implement JWT Authentication in Spring Boot Project?
No one can deny from the fact that Security is a vital feature of a production ready application. Although we can secure one web application using In-memory authentication, JDBC Authentication or via UserDetailsService. But when one application uses the services of other application internally, then implementation of security with webservices concept becomes important. In this situation we secure our application using a token which has a particular period of validity. Further, we are going to learn 'How to implement JWT Authentication in Spring Boot Project?' to understand the concept behind JWT(JSON Web Token) Authentication as a whole. As JWT stands for 'JSON Web Token', it is clear that the token holds the data in the form of JSON only. Moreover, unlike
Spring Security UserDetailsService Using Spring Boot 3
In continuation to series of articles on Spring Security, here in this article we will learn 'How to implement Security in Spring Boot using UserDetailsService With Spring Boot 3?'. After going through the previous articles, I hope we all are very familiar with basics of Security and even the basics of Security in a Spring Boot application. After the release of Spring Boot 3, here we are going to implement 'Spring Security UserDetailsService Using Spring Boot 3'. In this article, we will create a user registration form and save users with their roles in the database. Then, based on the user role, we will check the authentication and authorization functionalities with the help of predefined UserDetailsService. To illustrate, we will take some
Spring Security Annotations With Examples
In this article, we will discuss on Spring Security Annotations with examples. Obviously, these annotations can be used in a Spring Boot project as well. These annotations play a crucial role in creating a web application in Spring Boot. If you want to learn all annotations which are generally used in a Spring Boot Project, kindly visit our article 'Spring Boot Annotations with Examples'. Let's discuss about 'Spring Security Annotations with examples' here only. Spring Security Annotations With Examples First of all, in order to use Security related annotations in our Spring Boot project, we need to add security starter dependency. If you created a project using STS (Spring Tool Suite), you have to select 'Spring Security' starter or else add the
Spring Security Without WebSecurityConfigurerAdapter
websecurityconfigureradapter deprecated In the context of the Spring Security module, WebSecurityConfigurerAdapter is an abstract class which has been deprecated from Spring Security 5.7.0-M2 as per an announcement posted in the Spring Official website, on 21st Feb, 2022. It was generally used to extend configure() methods by a custom configuration subclass. As a result, it encourages users to move towards a component-based security configuration. To support with the change to this new design of configuration, we will discuss a list of common use-cases and the proposed alternatives going forward. Therefore, we will discuss about the implementation of use cases of Spring Security Without WebSecurityConfigurerAdapter. It is important to know about this change because sooner or later we will be developing security features using