.NET Runtime
.NET: Microsoft Technologies based on the .NET software framework.Runtime: The period of time during which a program is being executed in a computer.
980 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi all;
We need to implement pretty much every common authentication & authorization protocol for both reading files and OData queries from a url via https. We need this for both .Net Framework & .Net Core.
Is there a way to do this generically in the .Net runtime? Or is there a listing somewhere of how to call .Net to get this.
Or any other ways to solve this problem?
thanks - dave
Hi Charles;
Yes, HttpClient is the basis for making a connection. But is there anything to help for the authentication & authorization needed on top of that for the various security protocols?
thanks - dave
Hi David,
Different web APIs may have different authentication & authorization flows and requirements, you may need to write codes to implement them because they are not unified.
Hi Charles;
Ok, we need to do this individually for each. Can you provide any information on how to write the code for any of the following:
thanks - dave
hi David, some references:
Claims-based authorization in ASP.NET Core
WindowsIdentity Class
Implement forms-based authentication in an ASP.NET application by using C#.NET
NTLM and Kerberos Authentication
And you can also search the implementation of different methods online, there are many guides.
I want to accept this as the answer - but it does not have that option.
Anyways, thank you
Sign in to comment
1 answer
Sort by: Most helpful
Hi,DavidThielen-2188
You can use WebClient.DownloadFile() to download the file from url and set authentication at the same time, like:
DownloadFileFromUrl
WebClient.DownloadFile
Best Regards,
Jerry Cai
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
Hi Jerry;
I don't understand how your solution will work for even basic or digest authentication. Not to mention MS Trust, OAuth2, etc. All of these require a username & password. Many require a client secret, token, etc.
Am I not understanding something?
thanks - dave
Sign in to comment