# Okta Swagger integration in ASP.NET Core

**URL:** <https://devforum.okta.com/t/okta-swagger-integration-in-asp-net-core/10767>\
**Category:** Questions\
**Tags:** dotnet, react\
**Created:** [September 1, 2020, 5:42pm UTC](https://devforum.okta.com/t/okta-swagger-integration-in-asp-net-core/10767 "2020-09-01T17:42:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pakun](https://avatars.discourse-cdn.com/v4/letter/p/65b543/32.png) [@Pakun](https://devforum.okta.com/u/Pakun)\
**Post date:** [September 1, 2020, 5:42pm UTC](https://devforum.okta.com/t/okta-swagger-integration-in-asp-net-core/10767/1 "2020-09-01T17:42:56Z")

</div>

Hi everyone,

I’m looking for a way to integrate swagger and okta, by this I mean I would like to allow the user to authenticate in swagger and get an acces token to be used for testing.  
Our current configuration consists of:

An SPA application configuren in Okta  
A React client secured using Okta’s SDK  
An [ASP.NET](http://ASP.NET) core API secured with OKTA and documented with Swagger UI

So far I could’t find a way or a resource explaining how to integrate swagger and OKTA in order to get an access token just like the react application does to consume the API, I also tried to get a token using postman following this link [https://developer.okta.com/docs/guides/implement-oauth-for-okta/request-access-token](https://developer.okta.com/docs/guides/implement-oauth-for-okta/request-access-token)  
but the access token obtained is incomplete (lacks of profile information needed to execute the endpoints).

Does anybody knows how to accomplish this?

---

<div class="post-metadata">

**Author:** ![Lijia](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/lijia/32/2295_2.png) [@Lijia](https://devforum.okta.com/u/Lijia)\
**Post date:** [September 9, 2020, 11:49pm UTC](https://devforum.okta.com/t/okta-swagger-integration-in-asp-net-core/10767/2 "2020-09-09T23:49:03Z")

</div>

@Pakun Which attribute you failed to retrieve in a token? Did you include profile in the scope? Here is a way to add customized attribute to the token: [https://support.okta.com/help/s/article/How-to-add-custom-attributes-of-user-profile-as-claims-in-token?language=en\_US](https://support.okta.com/help/s/article/How-to-add-custom-attributes-of-user-profile-as-claims-in-token?language=en_US)  
Also, for Swagger Integration, can you please refer the solution on stack overflow and see if it is helpful?  
[https://stackoverflow.com/questions/58196527/swagger-authorization-with-okta-configuration-jwt-token](https://stackoverflow.com/questions/58196527/swagger-authorization-with-okta-configuration-jwt-token)

---

<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 25, 2024, 12:22am UTC](https://devforum.okta.com/t/okta-swagger-integration-in-asp-net-core/10767/3 "2024-01-25T00:22:50Z")

</div>

Closed on January 25, 2024, 12:22am UTC


