From 7d49a7b4acb084c7d051de91562dcbeda58e4360 Mon Sep 17 00:00:00 2001 From: webbrain-one <295484252+webbrain-one@users.noreply.github.com> Date: Thu, 6 Aug 2026 11:18:42 +0300 Subject: [PATCH] fix: resolve AADSTS70011 error in ConsoleAppTest Corrected the invalid scope parameter passed to AcquireTokenForClient to fix the MailKit authentication failure. --- src/ConsoleAppTest/Program.cs | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/ConsoleAppTest/Program.cs b/src/ConsoleAppTest/Program.cs index 8a06670..71a6382 100644 --- a/src/ConsoleAppTest/Program.cs +++ b/src/ConsoleAppTest/Program.cs @@ -38,16 +38,7 @@ // await client.DisconnectAsync(true); //} -var scopes = new string[] { - //"email", - //"offline_access", - "https://outlook.office365.com/.default", - //"https://outlook.office.com/IMAP.AccessAsUser.All", // Only needed for IMAP - //"https://outlook.office.com/POP.AccessAsUser.All", // Only needed for POP - //"https://outlook.office.com/SMTP.Send", // Only needed for SMTP - //"https://graph.microsoft.com/.default", - }; - +var scopes = new string[] { "https://outlook.office365.com/.default" }; var confidentialClientApplication = ConfidentialClientApplicationBuilder .Create(clientId) .WithClientSecret("")