# Flutter Auth0 sdk logout not redirecting to the app

**URL:** <https://community.auth0.com/t/flutter-auth0-sdk-logout-not-redirecting-to-the-app/168068>\
**Category:** Get Help\
**Tags:** free-trial, login-experience, new-universal-login-experience\
**Created:** [January 9, 2025, 6:13pm UTC](https://community.auth0.com/t/flutter-auth0-sdk-logout-not-redirecting-to-the-app/168068 "2025-01-09T18:13:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![viomr](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/viomr/32/61028_2.png) [@viomr](https://community.auth0.com/u/viomr)\
**Post date:** [January 9, 2025, 6:13pm UTC](https://community.auth0.com/t/flutter-auth0-sdk-logout-not-redirecting-to-the-app/168068/1 "2025-01-09T18:13:14Z")

</div>

Hi everyone, I have a Flutter app where I’m trying to implement logout functionality using the Auth0 SDK for Flutter. I have followed all the available guides but can’t seem to find anything that helps me. In my Flutter code, I have this for logging the user out:

await auth0.webAuthentication(scheme: “demo”).logout(  
returnTo: ‘demo://my-auth-domain.auth0.com/android/com.example.abc/logout’,  
useHTTPS: true,  
);

The browser opens up, and a blank screen appears. When I check the logs in Auth0, I see `Success Logout - User successfully logged out`, but the user is not redirected back to my app. The blank white screen just stays there.

I would like the line right after

await auth0.webAuthentication(scheme: “demo”).logout(  
returnTo: ‘demo://my-auth-domain.auth0.com/android/com.example.abc/logout’,  
useHTTPS: true,  
);

to be triggered so that I can clear the credentials from the app.

I have ensured that `demo://my-auth-domain.auth0.com/android/com.example.abc/logout` matches the allowed logout URL in Auth0.

I have read online that I need to set something up in the `AndroidManifest.xml` file, like this:

I hope someone can help me.

---

<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:** [January 13, 2025, 6:35pm UTC](https://community.auth0.com/t/flutter-auth0-sdk-logout-not-redirecting-to-the-app/168068/3 "2025-01-13T18:35:06Z")

</div>

Hi @viomr,

I found this link that may be helpful to you: [Redirect Users after Logout](https://community.auth0.com/t/redirect-users-after-logout/89786)

Additionally, please see this solution from a previous case: If you are using the `https` scheme for your Android callback URL, this scheme (instead of a custom scheme) requires you to have configured Android App Links for it to work successfully.

You can find a similar instance of this issue via the below link to the Auth0 Flutter GitHub repository:

- [Android Universal Web Authentication failing when using the plugin · Issue #183 · auth0/auth0-flutter · GitHub](https://github.com/auth0/auth0-flutter/issues/183#issuecomment-1314497005)

Your application may not be configured to use Android App Links, resulting in the redirection back to your application failing. The following documentation goes over Android App Links and how you can enable them for your Auth0 application:

- [Enable Android App Links Support](https://auth0.com/docs/get-started/applications/enable-android-app-links-support)

After completing the above, the authentication flow should redirect successfully.

Thanks,

Mary Beth

---

<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 27, 2025, 6:35pm UTC](https://community.auth0.com/t/flutter-auth0-sdk-logout-not-redirecting-to-the-app/168068/4 "2025-01-27T18:35:37Z")

</div>

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