Spring Boot 3 Crash Course Part 6: Authentication and Authorization

Ben Meehan
6 min readDec 30, 2023

In this part we will be looking at how to authenticate and authorize users using Spring Boot.

Link to Part 5

Part 7 Now Available: Here

Table of Contents:

  1. What is Authentication and Why Do We Need It?
  2. What is Authorization?
  3. Spring Security Module
  4. How Spring Security Works
  5. Logging In Users
  6. Allowing Only Specific Users

Pre-requisites:

  1. How to create an API using Spring Boot
  2. How to access the database using Spring Boot

What is Authentication and Why Do We Need It?

Authentication is basically making sure that the user is who they say they are. In many cases, we want to make sure that the person who is accessing our website is registered with us and not some random person.

For example, say you go to Instagram. Instagram wants to make sure that only you are registered with them and they ask you to login. This is called authenticating or verifying the users identity.

--

--

Ben Meehan

Software Engineer at Razorpay. Sharing knowledge and experiences.