Search code examples
asp.net-web-api2owin-middleware.net-core-2.0

.Net Core 2 - How to add and use Authentication service (Jwt endpoint)


I am using .Net Core 2. I need to add a simple token endpoint. I was following this article but found that the below method is obsolete in .Net Core 2

app.UseJwtBearerAuthentication();

Quoting the second link:

Configure(): UseXyzAuthentication() has been replaced by ConfigureService(): AddXyz()

Therefore, in ConfigureService method, i am trying to use something like

services.AddAuthentication(new JwtBearerOptions());

which is not correct, i know but how to achieve this? Unfortunately, i couldn't find any help on web.

Thanks


Solution

  • These are implemented some what in a more efficient manner in core 2.0 possible duplicate