# Getting "Invalid state." error trying to sign in from MAUI app with Microsoft Account

**URL:** <https://community.auth0.com/t/getting-invalid-state-error-trying-to-sign-in-from-maui-app-with-microsoft-account/114532>\
**Category:** Get Help\
**Tags:** other-built-in-social-connections, connections\
**Created:** [August 25, 2023, 5:07pm UTC](https://community.auth0.com/t/getting-invalid-state-error-trying-to-sign-in-from-maui-app-with-microsoft-account/114532 "2023-08-25T17:07:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bluedot2](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@bluedot2](https://community.auth0.com/u/bluedot2)\
**Post date:** [August 25, 2023, 5:07pm UTC](https://community.auth0.com/t/getting-invalid-state-error-trying-to-sign-in-from-maui-app-with-microsoft-account/114532/1 "2023-08-25T17:07:10Z")

</div>

I’ve been using Auth0 from a .NET MAUI app for about four months (I followed the instructions here: [Add Authentication to .NET MAUI Apps with Auth0](https://auth0.com/blog/add-authentication-to-dotnet-maui-apps-with-auth0/)).

Suddenly today, when users try to sign in with Microsoft accounts, in IdentityModel.OidcClient.LoginResult from the OidcClient.LoginAsync() call, I’m getting the error “Invalid state.”. Logins using Google or email/password still work. I haven’t changed anything in my Auth0 configuration or deployed a new version of my app.

I tried to Unlink in Auth0 User Management to revoke my token, to no avail (I’m still not even prompted to sign in to my Microsoft Account). When I look at the logs in the Auth0 dashboard for my account I see “Successful login”.

Any ideas would be appreciated.

Regards,  
Glen

---

<div class="post-metadata">

**Author:** ![bluedot2](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@bluedot2](https://community.auth0.com/u/bluedot2)\
**Post date:** [August 25, 2023, 8:33pm UTC](https://community.auth0.com/t/getting-invalid-state-error-trying-to-sign-in-from-maui-app-with-microsoft-account/114532/2 "2023-08-25T20:33:37Z")

</div>

FYI, I went to the Microsoft Account page to manage apps I’ve given access to ([Sign in to your Microsoft account](https://account.live.com/consent/manage)), removed access to my app, and tried signing in again and it worked. Not sure what caused the issue, but I will need to inform my users to do the same thing and hope it doesn’t happen again.

Glen

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [September 8, 2023, 8:34pm UTC](https://community.auth0.com/t/getting-invalid-state-error-trying-to-sign-in-from-maui-app-with-microsoft-account/114532/3 "2023-09-08T20:34:17Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
