Toptal
Today we’ll have a look at how easy it is to integrate JSON web token (JWT) authentication into your Angular 6 (or later) single-page application (SPA). Let’s start with a bit of background.
What Are JSON Web Tokens, and Why Use Them?
The easiest and most concise answer here is that they are convenient, compact, and secure. Let’s look at those claims in detail:
Convenient: Using a JWT for authentication to the back end once logged in requires setting one HTTP header, a task which can be easily automated through a function or subclassing, as we’ll see later. Compact: A token is simply a base64-encoded string, containing a few header fields, and a payload if required. The total JWT is usually less than 200 bytes, even if signed. Secure: While not required, a great security feature of JWT is that tokens can be signed using either RSA public/private key-pair encryption
To read the full article click on the 'post' link at the top.