UseWindowsAzureActiveDirectoryBearerAuthentication does not exist in ASP.NET 5 RC1-Final

We used to

app.UseWindowsAzureActiveDirectoryBearerAuthentication( new WindowsAzureActiveDirectoryBearerAuthenticationOptions { Audience = ConfigurationManager.AppSettings["ida:Audience"], Tenant = ConfigurationManager.AppSettings["ida:Tenant"], }); 

for authentication with Azure. The problem is that today we upgraded to ASP.NET 5 RC1-FINAL , and now this method no longer exists.

I searched the net for other solutions, but the ones I found use some third part authentication services or .UseOAuthBearerAuthentication, which are not available in RC1-Final.

+5
source share
1 answer

This AAD-specific extension method has not been ported to vNext. Instead, you are encouraged to directly use the middleware for the JWT Explorer:

 app.UseJwtBearerAuthentication(options => { options.AutomaticAuthenticate = true; options.AutomaticChallenge = true; options.Authority = "https://login.windows.net/tratcheroutlook.onmicrosoft.com"; options.Audience = "63a87a83-64b9-4ac1-b2c5-092126f8474f"; }); 
+5
source

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


All Articles