5

I am using the AppAuth library and I want it to use custom tabs but it never does on the emulator with play store support or on my device which is an HTC U11 running Oreo. Chrome is installed. I have tried a bunch of configurations but no luck.

    val authService = AuthorizationService(applicationContext)

    val authIntent = authService.getAuthorizationRequestIntent(authRequest,
            authService.createCustomTabsIntentBuilder(Uri.parse(authorizationManager.openIdConfig!!.authorization_endpoint)).build())

    startActivityForResult(authIntent, REQUEST_AUTH)

I tried with and without the createCustomTabsIntentBuilder, exact same results either way. Figure I am missing one last piece of secret sauce here, just don't know what it is.

Everything works fine, I do get authorized, rest of code works, it just always uses an external browser.

** SOLVED ** The current AppAuth library does not support AndroidX. I pulled the code for the library, added it as a module to my app, updated the code to AndroidX and changed one line to use the proper CustomTab string and now it all works as expected.

BrowserSelector.java line 187 is now

 serviceIntent.setAction(CustomTabsService.ACTION_CUSTOM_TABS_CONNECTION);
Kevin
  • 1,405
  • 15
  • 16
  • Hi @Kevin. I'm with the same problem but unfortunately, I wasn't able to convert AppAuth to use androidx. Can you somehow share the library generated aar? Thanks – Favolas Feb 19 '19 at 14:46
  • I just included my updated package as a module in my app. I have not created an AAR file from it. If you have ideas of how I could get the code to you I would be more than happy to send it your way. – Kevin Feb 20 '19 at 15:15
  • Thanks. Don't know if it is possible to share a link from something like wetransfer here or a github repo :( – Favolas Feb 20 '19 at 19:48

0 Answers0