Add ASP.NET Web API Authentication in Visual Studio 2015 to an Existing Project

In Visual Studio 2015, when you select a web API template, you can now select No Authentication, Individual User Accounts, Organizational Accounts, or Windows Authentication. Visual Studio then generates a large amount of code and automatically includes many self-generated packages.

If I already have an ASP.NET Web API project without authentication, can I add all the generated code and packages for one of these authentication options without having to rebuild the solution from scratch or manually add each package?

Thanks -

+5
source share
1 answer

If you use the nuget package manager to search for an identifier, you should install it there. There is also an equivalent nuget command line for nuget: Install-Package Microsoft.AspNet.Identity.Samples -Pre

Be careful. The current version is pre-release and may also install several dependent components that may cause problems.

As in all such cases, it is recommended to make a full backup of the solution before starting the process!

0
source

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


All Articles