title: .Net-Core built in Authorization Code Flow
body: <p>I'm working on simplifying my Login Process for my application.  preemptively used IdentityServer for logins, but I don't need an entire token server so I'm now in the process of downgrading to just use Asp.Net Identity.</p>
  
  <p>Prior I use to be able to login through third parties by doing this:</p>
  
  <pre><code>[HttpPost]
  [AllowAnonymous]
  [ValidateAntiForgeryToken]
  public IActionResult ExternalLogin(string provider, string returnUrl = null)
  {
      // Request a redirect to the external login provider.
      var redirectUrl = Url.Action(nameof(ExternalLoginCallback), "Account", new { returnUrl });
      var properties = _signInManager.ConfigureExternalAuthenticationProperties(provider, redirectUrl);
      return Challenge(properties, provider);
  }
  </code></pre>
  
  <p>This allowed me to login with third parties such as (Coinbase) but I'm confused on how this worked, because I don't see a place where they receive the authorization code.</p>
  
  <p>I've obtained an authorization code from my oauth provider, and now I need to obtain the access tokens.  I can easily do so by manually making a request e.g</p>
  
  <pre><code>POST /oauth/token HTTP/1.1
  Host: authorization-server.com
  
  grant_type=authorization_code
  &amp;code=xxxxxxxxxxx
  &amp;redirect_uri=https://example-app.com/redirect
  &amp;client_id=xxxxxxxxxx
  &amp;client_secret=xxxxxxxxxx
  </code></pre>
  
  <p>But I feel like there is some built in functionality in .net to execute this request and store the tokens in a the user manager.  Does anyone know of a built in way to do so?</p>