# Verifying RS256 token using downloaded certificate

**URL:** <https://community.auth0.com/t/verifying-rs256-token-using-downloaded-certificate/8135>\
**Category:** Get Help\
**Tags:** certificate, jwks, token, rs256\
**Created:** [September 8, 2017, 4:46pm UTC](https://community.auth0.com/t/verifying-rs256-token-using-downloaded-certificate/8135 "2017-09-08T16:46:56Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![patrickrainier](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/patrickrainier/32/14214_2.png) [@patrickrainier](https://community.auth0.com/u/patrickrainier)\
**Post date:** [September 8, 2017, 4:46pm UTC](https://community.auth0.com/t/verifying-rs256-token-using-downloaded-certificate/8135/1 "2017-09-08T16:46:56Z")

</div>

I am able to successfully verify a RS256 token using the public key I extracted from the certificate which I downloaded on the clients page then I just passed that in my app as the secret. I am aware that the standard for verifying RS256 tokens should be through the jwks endpoint. What are the cons of how I am currently verifying my tokens?

---

<div class="post-metadata">

**Author:** ![jmangelo](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jmangelo/32/7923_2.png) [@jmangelo](https://community.auth0.com/u/jmangelo)\
**Post date:** [September 8, 2017, 5:29pm UTC](https://community.auth0.com/t/verifying-rs256-token-using-downloaded-certificate/8135/2 "2017-09-08T17:29:27Z")

</div>

The most notable difference between _hardcoding_ the public key versus obtaining it dynamically would be that in case of key rotation the dynamic approach would not imply any change on the client applications, while the other approach would indeed require manual intervention.

---

<div class="post-metadata">

**Author:** ![patrickrainier](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/patrickrainier/32/14214_2.png) [@patrickrainier](https://community.auth0.com/u/patrickrainier)\
**Post date:** [September 8, 2017, 5:45pm UTC](https://community.auth0.com/t/verifying-rs256-token-using-downloaded-certificate/8135/3 "2017-09-08T17:45:32Z")

</div>

How often do key rotations happen? Are they triggered by something? Or is just random?

---

<div class="post-metadata">

**Author:** ![patrickrainier](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/patrickrainier/32/14214_2.png) [@patrickrainier](https://community.auth0.com/u/patrickrainier)\
**Post date:** [September 8, 2017, 5:45pm UTC](https://community.auth0.com/t/verifying-rs256-token-using-downloaded-certificate/8135/4 "2017-09-08T17:45:32Z")

</div>

How often do key rotations happen? Are they triggered by something? Or is just random?

---

<div class="post-metadata">

**Author:** ![jmangelo](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jmangelo/32/7923_2.png) [@jmangelo](https://community.auth0.com/u/jmangelo)\
**Post date:** [September 8, 2017, 5:48pm UTC](https://community.auth0.com/t/verifying-rs256-token-using-downloaded-certificate/8135/5 "2017-09-08T17:48:36Z")

</div>

At this time, key rotations would only happen by your request or at most in very extreme situations as part of responding to a security incident. In conclusion, unless you request them which would mean it would be coordinated with you they are currently very unlikely to happen.

---

<div class="post-metadata">

**Author:** ![patrickrainier](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/patrickrainier/32/14214_2.png) [@patrickrainier](https://community.auth0.com/u/patrickrainier)\
**Post date:** [September 8, 2017, 5:51pm UTC](https://community.auth0.com/t/verifying-rs256-token-using-downloaded-certificate/8135/6 "2017-09-08T17:51:56Z")

</div>

Alright, I am now convinced. Will implement verifying through the jwks endpoint now. Thanks

---

<div class="post-metadata">

**Author:** ![sparekh](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@sparekh](https://community.auth0.com/u/sparekh)\
**Post date:** [February 12, 2018, 9:49am UTC](https://community.auth0.com/t/verifying-rs256-token-using-downloaded-certificate/8135/7 "2018-02-12T09:49:28Z")

</div>

Hi,

out of curiosity, could you elaborate on how i can verify token using downloaded certificate? I mean via code.

---

<div class="post-metadata">

**Author:** ![patrickrainier](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/patrickrainier/32/14214_2.png) [@patrickrainier](https://community.auth0.com/u/patrickrainier)\
**Post date:** [February 12, 2018, 4:51pm UTC](https://community.auth0.com/t/verifying-rs256-token-using-downloaded-certificate/8135/8 "2018-02-12T16:51:58Z")

</div>

What we did was read tje contents of the certificate file and set it as the jwt secret.

---

<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:** [March 2, 2018, 5:56am UTC](https://community.auth0.com/t/verifying-rs256-token-using-downloaded-certificate/8135/9 "2018-03-02T05:56:24Z")

</div>


