title: Store and access value obtained during startup from my controller
body: <p>I am using the opened connect middleware to authenticate with a third party oidc provider and everything is up and running as I would expect. During the token exchange I exchange my auth code for an access token which is successful but I then need to store this bearer token for use later in subsequent requests. The token exchange is done as part of my startup class (by overriding the <code>OpenIdConnectEvents</code> during the <code>OnAuthorizationCodeReceived</code> method) in the asp.net core project and I need to store and access that token in my controllers.</p>
  
  <p>As there is no “session” per se yet, what is the most effective (or recommended way) to store this token value from the startup class and make it accessible in my controllers?</p>
  
  <p>Ive tried to use IMemoryCache but despite putting the value in the cache during this startup phase, when I try and access that cache in my controller, it is always empty.</p>
  
  <p>Is there a better/preferred way of persisting values form the startup class for later use in the lifecycle?</p>
  
  <p>I can see in <code>HttpContext.Authentication.HttpAuthenticationFeature.Handler.Options</code> I have access to all the <code>OpenIdConnectOptions</code> properties and settings for oidc, but nowhere can I see the actual token value that I stored after the token exchange.</p>