Dear Einora
Good day!
Thank you for posting to Microsoft Community. We are glad to assist!
Based on your description, I understand you concern with unable to access your account due to error 50126.
You may have a try to do following troubleshooting to narrow down your issue:
May I know whether you have the same when you tried to login to other Microsoft products or only in Teams?
If your account is a federated account, it might require redirection to ADFS for authentication. The ROPC (password) flow doesn't support this redirection and tries to authenticate the user directly in Azure AD, which can cause this error. You may need to contact your IT admin to check this.
Clear Cached Credentials: You may have a try to clear the credential in your computer. Search for “Credential Manager” in the Start menu, open it, and remove any cached credentials related to Microsoft Teams.
I look forward to your response.
Please note that our initial response may not always resolve the issue immediately. However, with your help and more detailed information, we can work together to find a solution.
Thanks for your precious time and your understanding would be highly appreciated. Have a nice day!
Best regards,
Allen | Community Moderator