OpenID AppAuth和自定义标签-从未使用自定义标签,始终使用外部浏览器-为什么?

时间:2018-10-18 12:47:43

标签: android appauth android-customtabs

我正在使用AppAuth库,但我希望它使用自定义标签,但是在支持Play商店的仿真器或运行Oreo的HTC U11设备上,它永远不会使用。 Chrome已安装。我尝试了很多配置,但是没有运气。

    val authService = AuthorizationService(applicationContext)

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

    startActivityForResult(authIntent, REQUEST_AUTH)

无论是否使用createCustomTabsIntentBuilder,我都尝试过,两种方法的结果完全相同。图我在这里遗失了最后一块秘密酱,只是不知道它是什么。

一切正常,我得到了授权,其余代码都起作用,只是始终使用外部浏览器。

**已解决**当前的AppAuth库不支持AndroidX。我提取了该库的代码,将其作为模块添加到我的应用程序中,将代码更新为AndroidX,并更改了一行以使用正确的CustomTab字符串,现在一切正常。

BrowserSelector.java第187行现在

 serviceIntent.setAction(CustomTabsService.ACTION_CUSTOM_TABS_CONNECTION);

0 个答案:

没有答案