title: What is the equivalent of UseOAuthBearerAuthentication in an ASP.NET Core 2 application?
body: <p>I am upgrading a resource server that accepts access tokens from our oAuth server. In .NET 4.7, I had a startup configuration that looked like this:</p>
  
  <pre><code>appBuilder.UseOAuthBearerAuthentication(new OAuthBearerAuthenticationOptions());
  </code></pre>
  
  <p>When I add the Nuget Package 'Microsoft.Owin.Security.OAuth', I get a warning that the package is not compatable with the target .NETCoreApp. Makes sense, but I'm not sure what the new package is. </p>
  
  <p>I thought the package I needed was 'Microsoft.AspNetCore.Authentication.OAuth'. That allows me to add to startup:</p>
  
  <pre><code>services
       .AddAuthentication(OAuthDefaults.DisplayName)
       .AddOAuth("Bearer", options =&gt; options.AuthorizationEndpoint = "uhhh" );
  </code></pre>
  
  <p>Why would I be configuring an endpoint, I just want to look for an authorization token, not actually serve them up. This looks like the setup for an oAuth server, not a recipient. Also, the old 'OAuthBearerAuthenticationOptions' class allowed me to override things like 'AccessTokenFormat' but I'm not seeing that in the new options.</p>
  
  <p>Lastly, I see that there is the option to configure oauth this way:</p>
  
  <pre><code>app.UseOAuthAuthentication
  </code></pre>
  
  <p>But it complains that it's Obsolete, looks like a Core 1 version of 'AddOAuth', and nothing about AccessTokenFormat.</p>
  
  <p>Any ideas?</p>