---
title: "Discussion on \"JWT and OAuth explained\" | Hashnode"
description: "Discussion on \"JWT and OAuth explained\". JWT\nJSON Web Tokens (JWT) are a way to securely send information between different parts of a system. Think of it like a sealed envelope that anyone can verify came from the right place.\nA JWT has three parts, separated by dots:\n\nHeader (what kind of..."
url: "https://hashnode.com/posts/jwt-and-oauth-explained/676e65e43bb4b435f611e16c"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [JWT and OAuth explained](https://tigerabrodi.blog/jwt-and-oauth-explained?utm_source=hashnode&utm_medium=feed)

JWT JSON Web Tokens (JWT) are a way to securely send information between different parts of a system. Think of it like a sealed envelope that anyone can verify came from the right place. A JWT has three parts, separated by dots: Header (what kind of...

Dec 27, 2024 · 4 min read · tigerabrodi.blog  
Read the article

-   [#backend](https://hashnode.com/tag/backend)
-   [#apis](https://hashnode.com/tag/apis)
-   [#authentication](https://hashnode.com/tag/authentication)

## Written by

[Tiger Abrodi](https://hashnode.com/@tigerabrodi)

@tigerabrodi · Germany

  
[View profile](https://hashnode.com/@tigerabrodi)

Obsessed with crafting software.

Just a guy who loves to write code and watch anime.

## Responses 2

Markdown supported · ⌘↵ to post

[erdenee](https://hashnode.com/@erdenee)

[Jan 21, 2025](https://hashnode.com/posts/jwt-and-oauth-explained/676e65e43bb4b435f611e16c/comment/678f7af061e7920fb670efad)

what happens if refresh token is stolen?

[RAJAT](https://hashnode.com/@0xRajat)

[Jan 28, 2025](https://hashnode.com/posts/jwt-and-oauth-explained/676e65e43bb4b435f611e16c/comment/678f7af061e7920fb670efad#reply-679854c2e732cc8047fc707d)

If refresh token is stolen then the malicious user can access the real user's session (untill it is expired) and may generate a new token. Hackers may use techniques like session hijacking, XSS, or CSRF(cross-site request forgery) to get the token.

http-only cookies allow us to store sensitive data such as refresh tokens, in a way that cannot be accessed by JavaScript. This means that even if there are vulnerabilities in your code or third-party libraries, a hacker won't be able to retrieve the refresh token.

[Fabian Paucar](https://hashnode.com/@int-solutions)

[Jan 9, 2025](https://hashnode.com/posts/jwt-and-oauth-explained/676e65e43bb4b435f611e16c/comment/677ff2545b9e91d6ca544646)

I'm reading, you wait please
