Flutter Auth0 sdk logout not redirecting to the app

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.

Hi @viomr,

I found this link that may be helpful to you: Redirect Users after Logout

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:

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:

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

Thanks,

Mary Beth