title: IdentityServer4 - Using Refresh Tokens after following the Quickstart for Hybrid MVC
body: <p>I've followed the Quickstart in the documentation page and have a working configuration of three services (IdentityServer, one Api service, one ASPNET MVC application) using IdentityServer for authentication.</p>
  
  <p>Everything works perfectly (login, login, authorization, etc.) until after 1 hour when the access_token expires. At this point, the MVC application starts to receive (correctly) a 401 from the API service (since the token is expired). At that point, I know I should use the refresh_token to get a new access_token.</p>
  
  <p>I was looking for a mechanism that automatically refreshed the access_token and stumbled upon this: <a href="https://github.com/mderriey/TokenRenewal/blob/master/src/MvcClient/Startup.cs" rel="noreferrer">https://github.com/mderriey/TokenRenewal/blob/master/src/MvcClient/Startup.cs</a> (from <a href="https://stackoverflow.com/a/41557598/13828">this answer</a>). I tried to use that but it didn't work (the <code>TokenEndpointResponse</code> was null even though the authentication was successful).</p>
  
  <p>I understand how to use a <code>refresh_token</code> to get a new <code>access_token</code>, but after I have it, how would I go inserting it back into the cookie so that future request have access to the new tokens?</p>