Hi,
yes you can implement the oauth flow with API calls and I have a git repo that shows how.
I have something called a token service that grabs new tokens by using the authorization code flow. It is also written in .net core but works fine for .NET framework 4.x
Send me a private message with your email and I will grant you access to the source.