# Unable to generate Access Token for my application using Swagger dotnet core

**URL:** <https://devforum.okta.com/t/unable-to-generate-access-token-for-my-application-using-swagger-dotnet-core/12062>\
**Category:** Questions\
**Created:** [December 8, 2020, 9:09pm UTC](https://devforum.okta.com/t/unable-to-generate-access-token-for-my-application-using-swagger-dotnet-core/12062 "2020-12-08T21:09:42Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ayan.roy](https://avatars.discourse-cdn.com/v4/letter/a/4af34b/32.png) [@ayan.roy](https://devforum.okta.com/u/ayan.roy)\
**Post date:** [December 8, 2020, 9:09pm UTC](https://devforum.okta.com/t/unable-to-generate-access-token-for-my-application-using-swagger-dotnet-core/12062/1 "2020-12-08T21:09:42Z")

</div>

Hi Team  
I am new to OKTA and trying to setup with dotnet core 3.1

I am using Swagger for the API request. and getting the following Error  
{  
“error”: “invalid\_client”,  
“error\_description”: “Browser requests to the token endpoint must use Proof Key for Code Exchange.”  
}

Please Help.

---

<div class="post-metadata">

**Author:** ![warren](https://avatars.discourse-cdn.com/v4/letter/w/97f17d/32.png) [@warren](https://devforum.okta.com/u/warren)\
**Post date:** [December 9, 2020, 7:20pm UTC](https://devforum.okta.com/t/unable-to-generate-access-token-for-my-application-using-swagger-dotnet-core/12062/2 "2020-12-09T19:20:09Z")

</div>

It sounds like you’re getting the error because you’re not using the PKCE flow.

I’m not sure what your use case is but maybe it would be easier if you try out one of the sample apps from [https://github.com/okta/samples-aspnetcore#aspnet-core-3x-samples](https://github.com/okta/samples-aspnetcore#aspnet-core-3x-samples)

---

<div class="post-metadata">

**Author:** ![ayan.roy](https://avatars.discourse-cdn.com/v4/letter/a/4af34b/32.png) [@ayan.roy](https://devforum.okta.com/u/ayan.roy)\
**Post date:** [December 10, 2020, 11:20am UTC](https://devforum.okta.com/t/unable-to-generate-access-token-for-my-application-using-swagger-dotnet-core/12062/3 "2020-12-10T11:20:23Z")

</div>

Hi, thanks for your reply.  
I’ve a dotnet core web api and have setup the api documentation using Swagger UI. For development purpose I’ve setup the Swagger UI to use Authorization Code + PKCE flow to get token and access the authorised controllers. This is where I’m getting the error message.

---

<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:** [December 24, 2020, 1:17am UTC](https://devforum.okta.com/t/unable-to-generate-access-token-for-my-application-using-swagger-dotnet-core/12062/4 "2020-12-24T01:17:29Z")

</div>

So the token call is still being made on the front end, right? What type of client authentication are you passing and what is the application in Okta configured to use?

---

<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 19, 2024, 12:42am UTC](https://devforum.okta.com/t/unable-to-generate-access-token-for-my-application-using-swagger-dotnet-core/12062/5 "2024-01-19T00:42:14Z")

</div>

Closed on January 19, 2024, 12:42am UTC


