alkampfergit / DotNetCoreOauth2

16 stars 15 forks source link

Test Failure in ConsoleAppTest Using MailKit: AADSTS70011 Error with Invalid Scope #3

Open fpereiramapfrepr opened 1 month ago

fpereiramapfrepr commented 1 month ago

The test in the ConsolaAppTest is failing due to an error related to the ‘scope’ input parameter when using the MailKit library. The specific error message is:

Microsoft.Identity.Client.MsalServiceException: 'AADSTS70011: The provided request must include a 'scope' input parameter. The provided value for the input parameter 'scope' is not valid. The scope email https://outlook.office.com/IMAP.AccessAsUser.All is not valid. Trace ID: XXXXX Correlation ID: XXXXX'

The exact line that throws the error is "confidentialClientApplication.AcquireTokenForClient."

Prior to the test, all necessary setup was performed in Azure as shown in the YouTube video for the App Registration.

Thanks for your help and your videos are awesome!

yso8 commented 2 weeks ago

hey, did you manage to solve your problem? I currently have the same problem on my program, which has significantly the same code. When I run this solution I also get the error even if I set the scopes to 'https://graph.microsoft.com/IMAP.AccessAsUser.All'. I can't make any progress..

fpereiramapfrepr commented 1 week ago

Hi. Needed to make some changes at the Azure App Registration Level. Only manage to make work DotNetCoreOAuth2 the same way that he does in the video. https://www.youtube.com/watch?v=bMYA-146dmM

yso8 commented 1 week ago

Perfect, indeed, this video helped me execute the commands as other tutorials/documentation had misled me. I had resorted to using Gmail due to its simplicity, but now everything works. Thank you very much for your quick response!