(˃ 𖥦 ˂) wowie ! don'tcha just miss them old school marquees? (˶˃ ᵕ ˂˶) .ᐟ.ᐟ

Authentication Methods - A Deep(ish) Dive

Feb. 27, 2025

Here lies the ramblings of a madwoman; bumbling her way around in the darkness in an attempt to understand the wide world of websec…

… in the absolute broadest of strokes:

Now, let’s go a little deeper, shall we?

- JSON Web Tokens (JWT)

- How it works:

  1. Client sends credentials to sever
  2. Sever generates a JWT based on credentials, and provides it to user (following below structure).
    • For example, using the RS256 algorithm, the generated JWT is signed with the server’s private key, and verified by the client with the server’s public key. (JWT structure - https://jwt.io/)
  3. The client receives theJWT, which is stored in the client’s local storage/session storage/as a cookie. AKA, the state lives as a token on the client, instead of on the server (as is with typical session-based authentication).
    • Note: the client also verifies the JWT with the server’s public key, if using the RS256 algorithm.

- JWT-based Authentication Drawbacks


- How it works:

  1. Client provides credentials to the server
  2. Server generates a unique session ID for the client and stores the session details & state in its local database.
  3. Server sends the session ID back within an HTTP-only cookie, which is stored in the client browser’s cookie jar (a storage for key-value pairs - how cool is this name though-)
  4. The client sends this cookie back with subsequent requests, & each time, the server has to check the session against the value in the server’s database.
  5. Upon logout, session ID is cleared from both the client side and server database.

- Session-based Authentication Drawbacks:*


A brief comparison…

credit where credit is due, this is from ChatGPT, but it was used as a sanity check after I did the bulk of the manual research to build a basis of understanding. so, what am i saying by this? take… all of it with a grain of salt lol-

Helpful Resources: