# How to validate okta token in .netcore 3. 0 web api

**URL:** <https://devforum.okta.com/t/how-to-validate-okta-token-in-netcore-3-0-web-api/6674>\
**Category:** Questions\
**Created:** [October 22, 2019, 11:25am UTC](https://devforum.okta.com/t/how-to-validate-okta-token-in-netcore-3-0-web-api/6674 "2019-10-22T11:25:04Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ahsanshakir](https://avatars.discourse-cdn.com/v4/letter/a/76d3ee/32.png) [@ahsanshakir](https://devforum.okta.com/u/ahsanshakir)\
**Post date:** [October 22, 2019, 11:25am UTC](https://devforum.okta.com/t/how-to-validate-okta-token-in-netcore-3-0-web-api/6674/1 "2019-10-22T11:25:05Z")

</div>

I have tried couple of solution in my .netcore API but none of is working and there is no good documentation for it. Can i get the exact steps to validate the okta token which gets in authorization attribute with bearer token schema??

---

<div class="post-metadata">

**Author:** ![dragos](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/dragos/32/1313_2.png) [@dragos](https://devforum.okta.com/u/dragos)\
**Post date:** [October 23, 2019, 3:28am UTC](https://devforum.okta.com/t/how-to-validate-okta-token-in-netcore-3-0-web-api/6674/2 "2019-10-23T03:28:19Z")

</div>

Hi @ahsanshakir

Did you get a chance to check the article [here](https://developer.okta.com/quickstart-fragments/dotnet/aspnetcore-implicit/) and resource server example [here](https://github.com/okta/samples-aspnetcore/tree/master/resource-server)?

---

<div class="post-metadata">

**Author:** ![ahsanshakir](https://avatars.discourse-cdn.com/v4/letter/a/76d3ee/32.png) [@ahsanshakir](https://devforum.okta.com/u/ahsanshakir)\
**Post date:** [October 23, 2019, 8:48am UTC](https://devforum.okta.com/t/how-to-validate-okta-token-in-netcore-3-0-web-api/6674/3 "2019-10-23T08:48:48Z")

</div>

I have tried your suggested solution but it still not working and getting the following error  
www-authenticate: Bearer error=“invalid\_token”, error\_description=“The signature key was not found”

Any suggestion??

---

<div class="post-metadata">

**Author:** ![ahsanshakir](https://avatars.discourse-cdn.com/v4/letter/a/76d3ee/32.png) [@ahsanshakir](https://devforum.okta.com/u/ahsanshakir)\
**Post date:** [October 23, 2019, 8:53am UTC](https://devforum.okta.com/t/how-to-validate-okta-token-in-netcore-3-0-web-api/6674/4 "2019-10-23T08:53:16Z")

</div>

also getting this error  
contains authorization metadata, but a middleware was not found that supports authorization.  
my code is `services.AddAuthentication(options => { options.DefaultAuthenticateScheme = OktaDefaults.ApiAuthenticationScheme; options.DefaultChallengeScheme = OktaDefaults.ApiAuthenticationScheme; options.DefaultSignInScheme = OktaDefaults.ApiAuthenticationScheme; }) .AddOktaWebApi(new OktaWebApiOptions { OktaDomain = Configuration["OktaConfiguration:Domain"] });`

I gets my token by calling `getAccessToken()` react js method.

---

<div class="post-metadata">

**Author:** ![andrea](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/andrea/32/2172_2.png) [@andrea](https://devforum.okta.com/u/andrea)\
**Post date:** [January 24, 2024, 6:37pm UTC](https://devforum.okta.com/t/how-to-validate-okta-token-in-netcore-3-0-web-api/6674/5 "2024-01-24T18:37:13Z")

</div>

Closed on January 24, 2024, 6:37pm UTC


