Auth0 Home Blog Docs

User Log out with LogoutUrl in Auth0.Android

Hi There,

i’m using Auth0.Android (com.auth0.android:auth0:1.15.1) for handling user athentication in my android app. Now I have a question regarding the user log out which i handle the following way:

  1. Clear the Credentials from the CredentialsManager
  2. Clear the cookies, which will force ultimately the logout:

final Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(logoutUrl));
browserIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(browserIntent);

Everything works fine so far. The only thing is, that the browser app (e. g. Chrome or Firefox) which i’m calling with Intent.ACTION_VIEW opens and stays open next to my app. Is there a way to avoid this behavior? Or do you handle the log out in a different way?

Thank you very much in advance!
Best regards

Hey there!

Not an Android guy but let me research it with the team and get back to you soon!

1 Like

Hi Konrad, did you already had the chance to reach out to your team regarding my question? Thank you very much!

Hey there Marius!

Yep but I didn’t get an answer yet. I’ll reping the person and get back to you as soon as I get any info back!

Unfortunately it seems like it’s not doable with a Browser app. Maybe with CustomTabs would work.
Check the latest release in which we added native support for logout:

1 Like

Great improvement to provide native support for the logout!!

We’ve got you covered!

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