# If the HEADER the same and the PAYLOAD the same, the TOKEN the same?

**URL:** <https://community.auth0.com/t/if-the-header-the-same-and-the-payload-the-same-the-token-the-same/114200>\
**Category:** JWT.io\
**Created:** [August 22, 2023, 10:26am UTC](https://community.auth0.com/t/if-the-header-the-same-and-the-payload-the-same-the-token-the-same/114200 "2023-08-22T10:26:24Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![13524063481](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@13524063481](https://community.auth0.com/u/13524063481)\
**Post date:** [August 22, 2023, 10:26am UTC](https://community.auth0.com/t/if-the-header-the-same-and-the-payload-the-same-the-token-the-same/114200/1 "2023-08-22T10:26:24Z")

</div>

if the TOKEN expires, and you login next time, assuming that the HEADER still uses the same algorithm, and the PAYLOAD remains unchanged(the user information remains unchanged), is the calculated signature by the server the same as last time? The TOKEN issued twice isn’t the same？

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [August 23, 2023, 7:41pm UTC](https://community.auth0.com/t/if-the-header-the-same-and-the-payload-the-same-the-token-the-same/114200/3 "2023-08-23T19:41:12Z")

</div>

Hi @13524063481,

Welcome to the Auth0 Community!

I wouldn’t expect the payload to be the same, even if the user data hasn’t changed. Tokens have some claims to indicate when they are issued and when they expire (`iat` and `exp`). When these claims change, the signature changes.

---

<div class="post-metadata">

**Author:** ![13524063481](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@13524063481](https://community.auth0.com/u/13524063481)\
**Post date:** [August 26, 2023, 3:25am UTC](https://community.auth0.com/t/if-the-header-the-same-and-the-payload-the-same-the-token-the-same/114200/5 "2023-08-26T03:25:28Z")

</div>

So can I understand that the issued time and expiration time you mentioned will be reflected in payload both all , so that each calculated signature and token are different?

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [August 28, 2023, 1:41pm UTC](https://community.auth0.com/t/if-the-header-the-same-and-the-payload-the-same-the-token-the-same/114200/6 "2023-08-28T13:41:15Z")

</div>

Any change in the payload will cause the token signature to differ. Hope this helps!

---

<div class="post-metadata">

**Author:** ![suchislife801](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/suchislife801/32/50280_2.png) [@suchislife801](https://community.auth0.com/u/suchislife801)\
**Post date:** [August 29, 2023, 1:18pm UTC](https://community.auth0.com/t/if-the-header-the-same-and-the-payload-the-same-the-token-the-same/114200/7 "2023-08-29T13:18:25Z")

</div>

Perhaps what you want is to understand the registered claims. More specifically, `jti`.

RFC 7519 - JSON Web Token (JWT)

Section [4.1.7](https://datatracker.ietf.org/doc/html/rfc7519#section-4.1.7). “jti” (JWT ID) Claim

The “jti” (JWT ID) claim provides a unique identifier for the JWT. The identifier value MUST be assigned in a manner that ensures that there is a negligible probability that the same value will be accidentally assigned to a different data object; if the application uses multiple issuers, collisions MUST be prevented among values produced by different issuers as well. The “jti” claim can be used to prevent the JWT from being replayed. The “jti” value is a case- sensitive string. Use of this claim is OPTIONAL.

```typescript
const jti: string = window.crypto.randomUUID();

```

```auto
4b66fc8e-4ac1-4a8d-b5ee-537a0c4e8e59

```

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [August 29, 2023, 7:32pm UTC](https://community.auth0.com/t/if-the-header-the-same-and-the-payload-the-same-the-token-the-same/114200/8 "2023-08-29T19:32:27Z")

</div>

Thanks for the added context @suchislife801

---

<div class="post-metadata">

**Author:** ![13524063481](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@13524063481](https://community.auth0.com/u/13524063481)\
**Post date:** [August 30, 2023, 3:32am UTC](https://community.auth0.com/t/if-the-header-the-same-and-the-payload-the-same-the-token-the-same/114200/9 "2023-08-30T03:32:19Z")

</div>

Thank you for your reply

---

<div class="post-metadata">

**Author:** ![13524063481](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@13524063481](https://community.auth0.com/u/13524063481)\
**Post date:** [August 30, 2023, 3:33am UTC](https://community.auth0.com/t/if-the-header-the-same-and-the-payload-the-same-the-token-the-same/114200/10 "2023-08-30T03:33:51Z")

</div>

Thank you for your help

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [September 13, 2023, 3:34am UTC](https://community.auth0.com/t/if-the-header-the-same-and-the-payload-the-same-the-token-the-same/114200/11 "2023-09-13T03:34:43Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
