title: OpenIddict: Share authentication between ASP.NET Core application and WEB.API Application
body: <p>I have an asp.net core web application that using OpenIddict. It works fine and users can login.
  Now I want to add web.api hosted on separate subdomain, but because the user is already authenticated I want to somehow share that authentication.
  Is it possible? How can I do it? I see in the examples for OpenIddict user have to authenticate again, but I do not want that.</p>
  <p>My Setup:</p>
  <ul>
  <li>ASP.NET Core Web App: <strong>app.domain.com</strong></li>
  <li>OpenIddict server: <strong>login.domain.com</strong></li>
  <li>Web API .net Core App: <strong>api.domain.com</strong> (that is new requirement)</li>
  </ul>
  <p>My web application has views that display data from controllers, I want to add extra javascript logic, and I can have web.api as part of the asp.net core domain: <strong>app.domain.com/api/</strong>
  in that case, it works, the authenticated shared between web application and API,
  but my goal is to have web.api on a separate subdomain: <strong>api.domain.com</strong>
  I know I have to create a Bearer token, but it is not clear how to do it without authenticating the user again. So I want somehow share ASP.NET Core web application authentication to access api.domain.com</p>
  <p>Can you please point me in the right direction? Where to start looking?</p>