Authenticate users from a C# Console Application

SDK: GitHub - auth0/auth0-aspnetcore-authentication: SDK for integrating Auth0 in ASPNET Core
SDK: latest
Platform Version: .Net 6

Hello,

I would like to provide my users with a Console App (CLI) to interact with a service Api. The CLI is written in .Net 6 C#. What I think I should do is to run a webserver when the user request to authenticate (example: mycli auth). That should open a browser link with the auth0 user/pass UI and it should return the success token or error back to the CLI so that I can eventually store in a local file the refresh token. I can’t find the correct authentication flow scenario or an example. I found the .net core SDK but all the docs are made to be used by a Web App.

Could you please confirm if I can use the GitHub - auth0/auth0-aspnetcore-authentication: SDK for integrating Auth0 in ASPNET Core from a CLI and eventually if there is an example?

Many thanks
Riccardo

1 Like

Anyone willing to help?

What I need is a tutorial or article showing how to open the webpage to login. That page is triggered from within the console application. Looking at other libraries like the one from microsoft, it helps showing the url to the user and listen for the refresh token once authenticated.

I can’t find this looking at the Device flow. It seems the Device flow working for TV’s but not console application. Or otherwise I’m not understanding the steps in the tutorial

Thanks