Implementing authentication using Spring Security and JWT
Spring Security is a framework consisting of a collection of libraries that allow you to implement enterprise application security without worrying about writing boilerplate code. In this chapter, we will use the Spring Security framework to implement token-based (JWT) authentication and authorization. Throughout the course of this chapter, you will also learn about CORS and CSRF configuration.
It’s useful to know that Spring Security also provides support for opaque tokens, just like it does for JWTs. The main difference between them is how information is read from the token. You can’t read the information from an opaque token the way you can with a JWT – only the issuer is aware of how to do this.
Note
A token is a string of characters such as
5rm1tc1obfshrm2354lu9dlt5reqm1ddjchqh81 7rbk37q95b768bib0j
f44df6suk1638sf78cef7
hfolg4ap3bkighbnk7inr68ke780744fpej0gtd 9qflm999o8q
...