# Dotnet core applying refresh token

**URL:** <https://devforum.okta.com/t/dotnet-core-applying-refresh-token/2172>\
**Category:** OAuth/OIDC\
**Tags:** dotnet\
**Created:** [July 13, 2018, 12:58pm UTC](https://devforum.okta.com/t/dotnet-core-applying-refresh-token/2172 "2018-07-13T12:58:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Savij](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/savij/32/600_2.png) [@Savij](https://devforum.okta.com/u/Savij)\
**Post date:** [July 13, 2018, 12:58pm UTC](https://devforum.okta.com/t/dotnet-core-applying-refresh-token/2172/1 "2018-07-13T12:58:48Z")

</div>

Hi,

I have okta oidc setup and working with a dotnet core 2.1 mvc application. I am able to log a user in with Code flow. The user passes bearer tokens to the api for each call. If a call returns a 401, I want to try to refresh the token. I am able to call out to okta, and I get the refresh token just fine. I’m just not sure how I can “apply” the new info. I want to replace the access\_token, refresh\_token and update the cookie with the new info I received from the /token call. Since I just use .AddOpenIdConnect(o =\> …) in Startup.cs and dotnet core sets up the token for me once the user auth’s, I am not sure how to implement refresh token support.

Am I overthinking this one? Is the refresh flow already “built-in” like the code flow??? I have not actually tested a real expired token to see if it refreshes auto-magically…

I can’t find much info on the googles so I am posting here for help. Thanks for any!  
-Jeff

---

<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 12, 2024, 10:46pm UTC](https://devforum.okta.com/t/dotnet-core-applying-refresh-token/2172/2 "2024-01-12T22:46:14Z")

</div>

Closed on January 12, 2024, 10:46pm UTC


