You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Test Failure in ConsoleAppTest Using MailKit: AADSTS70011 Error with Invalid Scope #3
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.
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..
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
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!
Hi there! Thanks so much for the kind words about the videos 🙌 I've opened a pull request to address this: #5
The fix updates the scope configuration to properly align with the client credentials flow, which resolves the AADSTS70011 invalid scope error when calling AcquireTokenForClient. Give it a try when you get a chance and let me know if everything runs smoothly!
Activity
yso8 commentedon Jun 17, 2024
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 commentedon Jun 20, 2024
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 commentedon Jun 21, 2024
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!
webbrain-one commentedon Aug 6, 2026
Hi there! Thanks so much for the kind words about the videos 🙌 I've opened a pull request to address this: #5
The fix updates the scope configuration to properly align with the client credentials flow, which resolves the
AADSTS70011invalid scope error when callingAcquireTokenForClient. Give it a try when you get a chance and let me know if everything runs smoothly!