'How to use REST Api or CSOM in .NET 6 client app for Sharepoint on premise

In my SPA with ASP.NET Core backend, I want to create UI for uploading files that will be stored in Sharepoint 2016 hosted on premise.

I was just about to use C# CSOM, but it is only available for .NET Framework, not .NET 6.

I would use a REST API, but I can't find any sample on how to obtain authentication token. My Sharepoint site user forms based auth (username/password).



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source