OfficeDev / teams-toolkit

Developer tools for building Teams apps
Other
453 stars 184 forks source link

Getting ClientAuthError when trying to login to Microsoft 365 #12030

Closed miktam closed 1 month ago

miktam commented 2 months ago

Describe the bug Trying to log in to Microsoft 365, and after successful authentication in the browser, getting an error:

{"errorCode":"network_error","errorMessage":"Network request failed","subError":"","name":"ClientAuthError","correlationId":"eac8f190-0c88-4a55-856a-f2d1ac75d828"}

To Reproduce Steps to reproduce the behavior:

  1. Go to Teams Toolkit -> Accounts -> Microsoft 365
  2. Click on Sign In
  3. Login to Microsoft account
  4. See error

Expected behavior It works fine when I'm using Github Codespace

VS Code Extension Information (please complete the following information):

Additional context Add any other context about the problem here.

xiaolang124 commented 2 months ago

Are you using a proxy on your machine? If not, can you try running the msal auth-code sample and see what happens?

https://github.com/AzureAD/microsoft-authentication-library-for-js/tree/dev/samples/msal-node-samples

miktam commented 2 months ago

@xiaolang124 I am not using a proxy on my machine.

Thank you for the suggestion, I've run msal auth-node sample, and after running it, I'm getting 'OK' in the browser and successful logs in the console:

Msal Node Auth Code Sample app listening on port 3000!
Successfully acquired token using Authorization Code.
xiaolang124 commented 1 month ago

The Teams toolkit login flow uses the same process as this sample. Do you encounter login failures on your machine every time?

miktam commented 1 month ago

@xiaolang124 I've managed to make it work, using a new user on the same machine. now can authenticate in m365 without any issues. thank you for your support!

gukoff commented 3 weeks ago

I'm seeing the same error. Latest MacOS and extension.

This error message seems to be related to the m365 tooling in general:

It would be great to get a more informative error that suggests what's actually wrong.


Maybe helpful - I see this in the Developer tools when the error happens:

image