# Flutter auth0 logout exception: "a0.authentication\_canceled: The user closed the browser app so the logout was cancelled."

**URL:** <https://community.auth0.com/t/flutter-auth0-logout-exception-a0-authentication-canceled-the-user-closed-the-browser-app-so-the-logout-was-cancelled/164534>\
**Category:** Get Help\
**Tags:** new-universal-login-experience, login-experience\
**Created:** [December 19, 2024, 5:56pm UTC](https://community.auth0.com/t/flutter-auth0-logout-exception-a0-authentication-canceled-the-user-closed-the-browser-app-so-the-logout-was-cancelled/164534 "2024-12-19T17:56:42Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![borko](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/borko/32/62634_2.png) [@borko](https://community.auth0.com/u/borko)\
**Post date:** [December 19, 2024, 5:56pm UTC](https://community.auth0.com/t/flutter-auth0-logout-exception-a0-authentication-canceled-the-user-closed-the-browser-app-so-the-logout-was-cancelled/164534/1 "2024-12-19T17:56:42Z")

</div>

Hi, I’m trying to logout from auth0 using `auth0_flutter`, but instead getting exception from the title.

Before exception I see this URL in log, which seems fine to me:  
D/LogoutManager(25194): Using the following Logout URI: AUTH0\_DOMAIN/v2/logout?auth0Client=Auth0Client%3D&returnTo=AUTH0\_REDIRECT\_URI&client\_id=AUTH0\_CLIENT\_ID

This is my logout implementation:

```auto
await _auth0
          .webAuthentication(scheme: _environmentParamsService.getScheme())
          .logout(
            returnTo: _environmentParamsService.getAuth0RedirectUrl(),
          );

```

And here is a code for login:

```auto
await _auth0.webAuthentication(
        scheme: _environmentParamsService.getScheme()
    ).login(
        audience: _environmentParamsService.getAudience(),
        parameters: {
          'prompt': 'login',
        }
    );

```

Any tips please?

---

<div class="post-metadata">

**Author:** ![marybeth.hunter](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/marybeth.hunter/32/61955_2.png) [@marybeth.hunter](https://community.auth0.com/u/marybeth.hunter)\
**Post date:** [December 30, 2024, 4:46pm UTC](https://community.auth0.com/t/flutter-auth0-logout-exception-a0-authentication-canceled-the-user-closed-the-browser-app-so-the-logout-was-cancelled/164534/3 "2024-12-30T16:46:02Z")

</div>

Hi @borko,

Welcome to the Auth0 Community!

Can you confirm what device you using - Android or iOS? Can you also provide the Flutter SDK version you are using as well?

Thanks,

Mary Beth

---

<div class="post-metadata">

**Author:** ![borko](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/borko/32/62634_2.png) [@borko](https://community.auth0.com/u/borko)\
**Post date:** [December 31, 2024, 2:24pm UTC](https://community.auth0.com/t/flutter-auth0-logout-exception-a0-authentication-canceled-the-user-closed-the-browser-app-so-the-logout-was-cancelled/164534/5 "2024-12-31T14:24:56Z")

</div>

I’m using Android device and Flutter SDK: 3.24.3.

In the meantime I moved to [flutter\_web\_auth](https://pub.dev/packages/flutter_web_auth) and it works well. I couldn’t see some important differences between implementations and for now I’ll leave it.

---

<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:** [January 14, 2025, 2:25pm UTC](https://community.auth0.com/t/flutter-auth0-logout-exception-a0-authentication-canceled-the-user-closed-the-browser-app-so-the-logout-was-cancelled/164534/6 "2025-01-14T14:25:17Z")

</div>

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