1

I am using custom tabs for OAuth and don't want chrome to keep cookies when the login session is over. Google's app-auth library doesn't give any support for that. I thought, maybe opening up the custom tab in incognito mode would help me to solve this problem. Has anyone before run into the same problem. In custom tabs documentation I couldn't find anything helpful

eminuluyol
  • 197
  • 6
  • 1
    There is no support for creating an Incognito Custom Chrome Tab on Android. There is no way to clear the cache programmatically as well. – Asutosh Panda Mar 10 '21 at 15:15

2 Answers2

2

As described here and introduced here, it's now possible to use custom tabs with incognito mode.

Do so by adding the "com.google.android.apps.chrome.EXTRA_OPEN_NEW_INCOGNITO_TAB" extra to the Intent like so:

CustomTabsIntent.Builder().build()
        .apply {
            if (openNewIncognitoTab) {
                intent.putExtra("com.google.android.apps.chrome.EXTRA_OPEN_NEW_INCOGNITO_TAB", true)
            }
        }

Depending on the Chrome version, users will likely have to manually enable two Chrome flags for this to work:

chrome://flags/#cct-incognito
chrome://flags/#cct-incognito-available-to-third-party
Chris Lacy
  • 4,222
  • 3
  • 35
  • 33
0

It's not currently possible to start a Custom Tab in incognito mode.

andreban
  • 4,621
  • 1
  • 20
  • 49