In my case, I got the same error after I used Quickstart (step 1), then configured automatically .net sample (step 2), then download the code sample (step 3) as shown in the picture below.
All steps were done successfully except step 3. Microsoft code generates, generates app id, and app secret in the project successfully but the tenant was set to common in appsetting.json as seen in the image below.
I thought it was a valid thing but later found out that this caused the issue.
Solution:
I copied the Directory (tenant) ID, then replace common with tenant Id, and it worked. I am not sure if this is a bug in Azure Quickstart code generation.
Update
As I was reading recently, the reason for common.