# What validity tests make sense on client side

**URL:** <https://community.auth0.com/t/what-validity-tests-make-sense-on-client-side/12059>\
**Category:** JWT.io\
**Created:** [June 3, 2018, 8:21am UTC](https://community.auth0.com/t/what-validity-tests-make-sense-on-client-side/12059 "2018-06-03T08:21:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![simonh1000](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/simonh1000/32/8150_2.png) [@simonh1000](https://community.auth0.com/u/simonh1000)\
**Post date:** [June 3, 2018, 8:21am UTC](https://community.auth0.com/t/what-validity-tests-make-sense-on-client-side/12059/1 "2018-06-03T08:21:13Z")

</div>

What can I do to test validity of a JWT on the client side. I realise that I can NOT test against the secret key.

Tests I can think of:

- three sections
- header and the body need to represent json objects

Are there any rules on length/structure of signature? Anything I’m missing?

Beyond being able to access the fields of the body, so any other tests make sense - at the end of the day an invalid jwt will be rejected by the server when it is used

---

<div class="post-metadata">

**Author:** ![luis.rudge](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/luis.rudge/32/7073_2.png) [@luis.rudge](https://community.auth0.com/u/luis.rudge)\
**Post date:** [June 3, 2018, 5:43pm UTC](https://community.auth0.com/t/what-validity-tests-make-sense-on-client-side/12059/2 "2018-06-03T17:43:17Z")

</div>

If you’re using RS256 id\_token’s, then you can use [GitHub - auth0/idtoken-verifier: Lightweight RSA JWT verification](https://github.com/auth0/idtoken-verifier) to validate them.

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [December 17, 2018, 10:31am UTC](https://community.auth0.com/t/what-validity-tests-make-sense-on-client-side/12059/3 "2018-12-17T10:31:52Z")

</div>


