OneNoteDev / OneNoteAPIDiagnostics

11 stars 13 forks source link

Failing to log in - The sign-in name or password does not match one in the Microsoft account system. #5

Open nrogoff opened 1 year ago

nrogoff commented 1 year ago

I am getting this issue. I have tried several times and confirm credentials. I have also tried using the onmicrosoft.com domain too. Same error everytime. I suspect something to do with MFA?

Microsoft.SharePoint.Client.IdcrlException: The sign-in name or password does not match one in the Microsoft account system.
   at Microsoft.SharePoint.Client.Idcrl.IdcrlAuth.GetServiceToken(String securityXml, String serviceTarget, String servicePolicy)
   at Microsoft.SharePoint.Client.Idcrl.IdcrlAuth.GetServiceToken(String username, String password, String serviceTarget, String servicePolicy)
   at Microsoft.SharePoint.Client.Idcrl.SharePointOnlineAuthenticationProvider.GetAuthenticationCookie(Uri url, String username, SecureString password, Boolean alwaysThrowOnFailure, EventHandler`1 executingWebRequest)
   at Microsoft.SharePoint.Client.SharePointOnlineCredentials.GetAuthenticationCookie(Uri url, Boolean refresh, Boolean alwaysThrowOnFailure)
   at Microsoft.SharePoint.Client.ClientRuntimeContext.SetupRequestCredential(ClientRuntimeContext context, HttpWebRequest request)
   at Microsoft.SharePoint.Client.SPWebRequestExecutor.GetRequestStream()
   at Microsoft.SharePoint.Client.ClientContext.GetFormDigestInfoPrivate()
   at Microsoft.SharePoint.Client.ClientContext.EnsureFormDigest()
   at Microsoft.SharePoint.Client.ClientContext.ExecuteQuery()
   at Microsoft.Office.OneNote.OneNoteAPIDiagnostics.Utilities.<ExecuteQuery>b__16_0()
   at System.Threading.Tasks.Task.InnerInvoke()
   at System.Threading.Tasks.Task.Execute()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Office.OneNote.OneNoteAPIDiagnostics.Utilities.<ExecuteQuery>d__16.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Office.OneNote.OneNoteAPIDiagnostics.Utilities.<GetList>d__11.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Office.OneNote.OneNoteAPIDiagnostics.Utilities.<GetDocumentLibrary>d__9.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.Office.OneNote.OneNoteAPIDiagnostics.SiteCollectionForm.<GetInfoButton_Click>d__1.MoveNext()
rjwesten commented 7 months ago

Same issue. Anyone else get around it? I can't disable MFA.

matthewjlevy commented 7 months ago

I am having the same issue, seems the API Diagnostics tool doesn't support modern authentication and therefore MFA isn't supported. Anyone know of a workaround?

EnergiserX commented 2 months ago

You can create an 'app password' on your Microsoft account that will bypass the MFA. My understanding of good practices is that a new App Password should be created for each separate application, and they should be removed from your account as soon as your need for it is removed (i.e. I created a new one for this tool, and as soon as I finish using this tool (in the next hour or two) I will remove it). This can only be done on the "View Account" webpage, in the "Security Info" section.