Quote:
I want to implement . net core web api authentication into existing web applications and windows application like asp.net MVC, .net, SharePoint, wcf, wpf.
If by
implement you mean to
consume the Web API, then you just need to use the
HttpClient
that is provided in .NET Framework.
These tutorials show how to use HttpClient in .NET Framework (the non-.NET Core versions):
HttpClient Class (System.Net.Http) | Microsoft Docs[
^]
Call a Web API From a .NET Client (C#) - ASP.NET 4.x | Microsoft Docs[
^]
For the authentication part, it depends on which authentication you are using. There are several authentications (Basic, Bearer, etc.) please see the specific tutorials on that.
As long as you are using
HttpClient
, the authentications should work just fine (in .NET Core as well as .NET Framework, and the modern .NET 5).
This GitHub gist shows one usecase of the Basic authentication with
HttpClient
:
Simple C# .NET 4.5 HTTPClient Request Using Basic Auth and Proxy · GitHub[
^]
Quote:
Is there any other option to implement this concept.
Building the server-side authentication is a different thing and you do not have much choice there. You must stick to the framework of your development (.NET Core in this case, I assume).
See this link for more on that:
Overview of ASP.NET Core Authentication | Microsoft Docs[
^]
I have a few articles of my own that discuss this concept in detail (but not the authentication part), see this:
ASP.NET 5 Web API RESTful CRUDs and Windows 10 native application[
^]