Spring Security JWT Authentication In Detail

Anish Antony
Javarevisited
Published in
6 min readApr 9, 2021

--

In the previous article, we saw the basics of spring security. Now over this article we can explore how to do JWT authentication using spring security.

Photo by Georg Bommeli on Unsplash

Hope you know the basics of Spring Security. If you don't, please go back to my article about basic spring security and get an understanding of it.

In the previous article, the examples are described with java basic authentication. But there are some security problems with the java basic authentication.

What is Basic Authentication?

Each time a request is sent to the server, it would need to be authenticated so that the application can ensure that the request is from a valid user and identify the user. The easiest way to do this is by sending the username and password with each and every request.

The basic authentication doing exactly the same logic. The solution is to use Basic Auth, which requires sending the credentials with every request but as a header.

--

--

Anish Antony
Javarevisited

Fullstack Developer | Blogger | Experience on Java, Python, React, Angular, Golang | http://www.behindjava.com