title: Wep Api Sign In After Facebook Authentication
body: <p>I posted <a href="https://stackoverflow.com/questions/31161854/after-external-login-success-need-to-generate-token-response-for-application">this question</a> that was poorly phrased and didn't generate a response.  So I thought I'd simplify my question.</p>
  
  <p>In my web api, I need to sign the user into my application after facebook tells me they're authenticated.  If I had my own OAuth server I'd do:</p>
  
  <pre><code>OAuthAuthorizationServerOptions OAuthServerOptions = new OAuthAuthorizationServerOptions()
  {
      AllowInsecureHttp = true,
      TokenEndpointPath = new PathString("/token"),
      AccessTokenExpireTimeSpan = TimeSpan.FromDays(1),
      Provider = new AuthorizationServerProvider(container.Resolve&lt;IAuthenticationRepository&gt;())
  };
  
  app.UseOAuthAuthorizationServer(OAuthServerOptions);
  </code></pre>
  
  <p>which allows the user to login at my <code>/token</code> endpoint.  I don't want to expose the <code>/token</code> endpoint, as I'm only using external logins, but I need to hook into my OAuthServerProvider.  I'd like to generate a token from the server side, after facebook authenticates them.  How can I hook into my own OAuthServerProvider for a token?</p>