# JWT Decode .NET broke when setting RS256

**URL:** <https://community.auth0.com/t/jwt-decode-net-broke-when-setting-rs256/6773>\
**Category:** Get Help\
**Tags:** c, jwt-validation, aspnet\
**Created:** [May 27, 2017, 2:57am UTC](https://community.auth0.com/t/jwt-decode-net-broke-when-setting-rs256/6773 "2017-05-27T02:57:53Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Steve\_McNiven-Scott](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/steve_mcniven-scott/32/6579_2.png) [@Steve\_McNiven-Scott](https://community.auth0.com/u/Steve_McNiven-Scott)\
**Post date:** [May 27, 2017, 2:57am UTC](https://community.auth0.com/t/jwt-decode-net-broke-when-setting-rs256/6773/1 "2017-05-27T02:57:53Z")

</div>

This is the decode method I was using, worked fine, but when we moved to the RS256 it tanks when “verify” is true.

> <https://gist.github.com/sitefinitysteve/6cb632225d9e918b02921ebb94121a67#file-jwtdecode-cs-L61-L90>

Otherwise everything decodes okay… is this a concern?

---

<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:** [May 29, 2017, 5:07pm UTC](https://community.auth0.com/t/jwt-decode-net-broke-when-setting-rs256/6773/2 "2017-05-29T17:07:58Z")

</div>

It’s not recommended to roll your own JWT processing and verification logic. The best thing to do is to use an already established library that does that for you.

You can check the libraries section in [jwt.io](https://jwt.io), in particular the .NET ones. For .NET, in general, you would go with [System.IdentityModel.Tokens.Jwt](https://www.nuget.org/packages/System.IdentityModel.Tokens.Jwt/) from Microsoft.

---

<div class="post-metadata">

**Author:** ![Steve\_McNiven-Scott](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/steve_mcniven-scott/32/6579_2.png) [@Steve\_McNiven-Scott](https://community.auth0.com/u/Steve_McNiven-Scott)\
**Post date:** [May 29, 2017, 8:19pm UTC](https://community.auth0.com/t/jwt-decode-net-broke-when-setting-rs256/6773/3 "2017-05-29T20:19:37Z")

</div>

Oh great. that lib is included in sitefinity anyway… so the reason for not decoding your own is for security reasons?

---

<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:54am UTC](https://community.auth0.com/t/jwt-decode-net-broke-when-setting-rs256/6773/4 "2018-03-02T05:54:09Z")

</div>


