# How to validate my JWT against secret/key in c# WebApi

**URL:** <https://community.auth0.com/t/how-to-validate-my-jwt-against-secret-key-in-c-webapi/102369>\
**Category:** Get Help\
**Tags:** apis, application\
**Created:** [March 12, 2023, 6:47pm UTC](https://community.auth0.com/t/how-to-validate-my-jwt-against-secret-key-in-c-webapi/102369 "2023-03-12T18:47:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![floppabellic](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@floppabellic](https://community.auth0.com/u/floppabellic)\
**Post date:** [March 12, 2023, 6:47pm UTC](https://community.auth0.com/t/how-to-validate-my-jwt-against-secret-key-in-c-webapi/102369/1 "2023-03-12T18:47:02Z")

</div>

Hey guys. I have created auth0 API so can retrieve JWT if passing ‘audience’ while authenticating user.

I want to add JWT middleware to my .net WebApi application. I’m following quickstart provided in my API panel and everything is working fine.

But quickstart doesnt specify how can i force my middleware to validate that my JWT was been signed using specific secret (screenshot).

Are my thoughts right? Or i’m missing some puzzles and validation against specific secret is not required? How does API then can know if JWT why signed by valid authority? If it’s required what is the secret? Is it the secret that i see in my application dashboard?

Thank you in advance:)

![image](https://global.discourse-cdn.com/auth0/original/3X/2/5/25e3aee2a725b6e3a79f305c39fa041fa97d0c24.png)

---

<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:** [March 16, 2023, 5:54pm UTC](https://community.auth0.com/t/how-to-validate-my-jwt-against-secret-key-in-c-webapi/102369/2 "2023-03-16T17:54:45Z")

</div>

Hi @floppabellic,

Assuming you are referencing this [quickstart](https://auth0.com/docs/quickstart/backend/aspnet-core-webapi/01-authorization), the setup has tokens signed with an asymmetric signing algo, meaning they can be decoded with a public key.

That key is provided via a public endpoint, which your API can use to retrieve the key and validate the token.

Does that make sense?

Here’s some additional resources:

- [JSON Web Token (JWT) Signing Algorithms Overview](https://auth0.com/blog/json-web-token-signing-algorithms-overview/)
- [Signing Algorithms](https://auth0.com/docs/get-started/applications/signing-algorithms)
- [How to Explain Public-Key Cryptography and Digital Signatures to Non-Techies](https://auth0.com/blog/how-to-explain-public-key-cryptography-digital-signatures-to-anyone/)

---

<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:** [December 13, 2024, 11:50pm UTC](https://community.auth0.com/t/how-to-validate-my-jwt-against-secret-key-in-c-webapi/102369/3 "2024-12-13T23:50:39Z")

</div>

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