Click here to Skip to main content
15,887,214 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to implement . net core web api authentication into existing web applications and windows application like asp.net MVC, .net, SharePoint, wcf, wpf.

Can anyone have idea about this?

What I have tried:

I got few things like token based authentication can be implementing here.. Is there any other option to implement this concept.
Posted
Updated 23-Dec-20 12:03pm

1 solution

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[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900