Where is the IApplicationBuilder.UseJwtBearerAuthentication extension in ASP.net 5?

I saw examples that indicate that IApplicationBuilder has an extension method .UseJwtBearerAuthentication(Action<?> options) .

This SO question and AspNet.Security.OpenIdConnect.Server example server startup file seems to say that there is such an extension. On OpenIdConnect, I looked at the extensions folder and I don't see the extension named UseJwtBearerAuthentication. Even this blog says it should be included in ASP.net 5. I also tried to add Microsoft.AspNet.Security.OAuthBearer, 1.0. 0-beta3 in my project.json and link to it in Startup.cs. No help.

The only thing that I have different is that I use -beta7, but I do not think it matters.

+5
source share
2 answers

It depends on your version of execution. In beta 7, the package is called Microsoft.AspNet.Authentication. OAuthBearer , and in beta 8, the package is renamed to Microsoft.AspNet.Authentication. JwtBearer .

Since you are using beta7, add this to your project. json:

 "Microsoft.AspNet.Authentication.OAuthBearer": "1.0.0-beta7" 

Pro-tip: Never mix beta versions like beta versions and beta7 MVC packages.

+3
source

In RC2 there is

 Microsoft.AspNetCore.Authentication.JwtBearer Microsoft.AspNetCore.Authentication.OAuth 
+1
source

Source: https://habr.com/ru/post/1232053/


All Articles