title: Thinktecture IdentityServer v3 with WebForms and WebApi
body: <p>I am trying for a while to figure out how to solve SSO (Single Sign On) with Thinktecture IdentityServer v3 for a legacy webforms application. Unfortunately I am stacked.</p>
  
  <p>The infrastructure is like this:</p>
  
  <ul>
  <li>A WebForm App which need authentication and Authorization (possibly
  cookie or bearer token)</li>
  <li>A javascript lightweight app (once the user is authenticated) makes requests to an WebApi (which is on separate domain)</li>
  </ul>
  
  <p>I am having the following questions which hopefully will help me to bring things up:</p>
  
  <ol>
  <li>I can't make the legacy webforms application to redirect to IdentityServer, even with set  in the Web.Config. I have in the Startup.cs the app.UseCookieAuthentication(....) and app.UseOpenIdConnectAuthentication(....) correctly set ( I guess ). For MVC the [Authorize] attribute force the redirection to the IdentityServer. How this should be done for webforms?</li>
  <li>Is there a way once the user is logged in, to reuse the token stored in the cookie as bearer token to the WebApi calls, made from the javascript client. I just want to do the requests to the WebApi on behalf on currently logged user (once again the webforms app and the webapi are on different domains)</li>
  </ol>
  
  <p>Any help will be much appreciated.</p>
  
  <p>Thanks!</p>