title: How to obtain the token returned from Azure AD B2C in ASP Core 2.0?
body: <p>I have used Visual Studio's latest <em>New Project</em> wizard to create a ASP Core 2.0 Web page (Razor Pages) that uses Individual Accounts as my authentication option. I have created an Azure AD B2C tenant and validated that it works properly.</p>
  
  <p>When I run the web application that was created by the wizard and click <em>Log In</em> in the upper right, it redirects to my Azure AD B2C site, and I can properly login. </p>
  
  <p>After login, the callback url goes to the endpoint configured in my user secrets:</p>
  
  <pre><code> ...
   "CallbackPath": "/signin-oidc",
   ...
  </code></pre>
  
  <p>That all seems to work properly. I understand that the Azure AD B2C portal sends a token back to the above <code>/signin-oidc</code> callback path and stores it.</p>
  
  <p>How can I retrieve the value of that token?</p>
  
  <p>I've been following all of the Azure AD B2C guides, but not all of them have been updated to ASP Core 2.0, and none of them seem to use the code generated from the 15.4 VS wizard such:</p>
  
  <pre class="lang-cs prettyprint-override"><code>public void ConfigureServices(IServiceCollection services)
  {
      services.AddAuthentication(sharedOptions =&gt;
      {
          sharedOptions.DefaultScheme = CookieAuthenticationDefaults.AuthenticationScheme;
          sharedOptions.DefaultChallengeScheme = OpenIdConnectDefaults.AuthenticationScheme;
      })
      .AddAzureAdB2C(options =&gt; Configuration.Bind("AzureAdB2C", options))
      .AddCookie();
  
      services.AddMvc();
  }
  </code></pre>
  
  <p>Note: the <code>.AddAzureAdB2C(...)</code></p>
  
  <p>None of the B2C samples are using this so its difficult for me to follow.</p>
  
  <p>My end goal is to get the token and use that in a strongly-typed set of API classes I generated from Swagger using Autorest which require the token. </p>