# Need Okta .Net SDK method to get Access Token, Refresh Token, Id Token for a given input of Authorization Code, Redirect Url

**URL:** <https://devforum.okta.com/t/need-okta-net-sdk-method-to-get-access-token-refresh-token-id-token-for-a-given-input-of-authorization-code-redirect-url/24275>\
**Category:** OAuth/OIDC\
**Tags:** dotnet\
**Created:** [May 17, 2023, 2:09pm UTC](https://devforum.okta.com/t/need-okta-net-sdk-method-to-get-access-token-refresh-token-id-token-for-a-given-input-of-authorization-code-redirect-url/24275 "2023-05-17T14:09:46Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![gnvrt](https://avatars.discourse-cdn.com/v4/letter/g/4491bb/32.png) [@gnvrt](https://devforum.okta.com/u/gnvrt)\
**Post date:** [May 17, 2023, 2:09pm UTC](https://devforum.okta.com/t/need-okta-net-sdk-method-to-get-access-token-refresh-token-id-token-for-a-given-input-of-authorization-code-redirect-url/24275/1 "2023-05-17T14:09:46Z")

</div>

Need Okta .Net SDK method to get Access Token, Refresh Token, Id Token for a given input of Authorization Code, Redirect Url.

I need the equivalent .Net sdk method for the API [OpenID Connect & OAuth 2.0 API | Okta Developer](https://developer.okta.com/docs/reference/api/oidc/#token)

Can someone help me on the same.

---

<div class="post-metadata">

**Author:** ![erik](https://avatars.discourse-cdn.com/v4/letter/e/b5ac83/32.png) [@erik](https://devforum.okta.com/u/erik)\
**Post date:** [May 19, 2023, 7:35am UTC](https://devforum.okta.com/t/need-okta-net-sdk-method-to-get-access-token-refresh-token-id-token-for-a-given-input-of-authorization-code-redirect-url/24275/2 "2023-05-19T07:35:56Z")

</div>

Hello,

I suggest looking into our .NET SDK samples,

> **[GitHub - okta/samples-aspnet: samples-aspnet](https://github.com/okta/samples-aspnet)**
>
> samples-aspnet. Contribute to okta/samples-aspnet development by creating an account on GitHub.

> **[GitHub - okta/samples-aspnetcore: samples-aspnetcore](https://github.com/okta/samples-aspnetcore)**
>
> samples-aspnetcore. Contribute to okta/samples-aspnetcore development by creating an account on GitHub.

> **[GitHub - okta/samples-aspnet-webforms: Okta + ASP.NET Web Forms](https://github.com/okta/samples-aspnet-webforms)**
>
> Okta + ASP.NET Web Forms. Contribute to okta/samples-aspnet-webforms development by creating an account on GitHub.

> **[GitHub - okta/samples-blazor: samples-blazor](https://github.com/okta/samples-blazor)**
>
> samples-blazor. Contribute to okta/samples-blazor development by creating an account on GitHub.

---

<div class="post-metadata">

**Author:** ![gnvrt](https://avatars.discourse-cdn.com/v4/letter/g/4491bb/32.png) [@gnvrt](https://devforum.okta.com/u/gnvrt)\
**Post date:** [May 22, 2023, 4:43am UTC](https://devforum.okta.com/t/need-okta-net-sdk-method-to-get-access-token-refresh-token-id-token-for-a-given-input-of-authorization-code-redirect-url/24275/3 "2023-05-22T04:43:04Z")

</div>

All the available .Net SDK’s have not any method for accessing these endpoints

1. Authentication - [OpenID Connect & OAuth 2.0 API | Okta Developer](https://developer.okta.com/docs/reference/api/oidc/#token)  
1.1. Endpoint - /api/v1/authn  
1.2. SDK is available - Okta .NET Authentication SDK
2. Token - [OpenID Connect & OAuth 2.0 API | Okta Developer](https://developer.okta.com/docs/reference/api/oidc/#token)  
2.1. Endpoint - ${baseUrl}/v1/token  
2.2. SDK is not available
3. Revoke - [OpenID Connect & OAuth 2.0 API | Okta Developer](https://developer.okta.com/docs/reference/api/oidc/#revoke)  
3.1. Endpoint - ${baseUrl}/v1/revoke  
3.2. SDK is not available
4. Keys - [OpenID Connect & OAuth 2.0 API | Okta Developer](https://developer.okta.com/docs/reference/api/oidc/#keys)  
4.1. Endpoint - /api/v1/keys  
4.2. SDK is not available

I’m trying to write a wrapper library to have these functionalities like Authentication, Token fetching, Keys etc . Can you please help me on the same with the available .Net SDK’s.  
As per my analysis, I have not found a suitable .Net SDK for points (2,3,4). So, I have decided to call these end points manually.

Please help me with your inputs on the above thought process

---

<div class="post-metadata">

**Author:** ![Good-man](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/good-man/32/1692_2.png) [@Good-man](https://devforum.okta.com/u/Good-man)\
**Post date:** [November 20, 2023, 3:41pm UTC](https://devforum.okta.com/t/need-okta-net-sdk-method-to-get-access-token-refresh-token-id-token-for-a-given-input-of-authorization-code-redirect-url/24275/4 "2023-11-20T15:41:44Z")

</div>

Have you tried using the ApiClient? That is what I am trying now myself.

---

<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:** [February 15, 2024, 5:43pm UTC](https://devforum.okta.com/t/need-okta-net-sdk-method-to-get-access-token-refresh-token-id-token-for-a-given-input-of-authorization-code-redirect-url/24275/5 "2024-02-15T17:43:16Z")

</div>

Closed on February 15, 2024, 5:43pm UTC


