Callback on successful login for sso on chromeCustom tab

265 Views Asked by At

I am using CCT for sso Login.now once the login is successful, the cct is not coming back to app.

Suppose the success url contains "com.example.success://hello/success" m adding data as

<activity

        android:name=".ExampleActivity"
        android:exported="true">
        <intent-filter>
            <action android:name="android.intent.action.VIEW"/>

            <category
                android:name="android.intent.category.DEFAULT"/>
            <category
                android:name="android.intent.category.BROWSABLE"/>

            <data
                android:host="hello/success"
                android:scheme="com.example.success"/>

        </intent-filter>
    </activity>

From ExampleActivity i am launching CCT

val customTabsIntent = CustomTabsIntent.Builder() .addDefaultShareMenuItem() .setShowTitle(true)

   .build()

    CustomTabsHelper.addKeepAliveExtra(this, customTabsIntent.intent)
    CustomTabActivityHelper.openCustomTab(
        this, customTabsIntent, Uri.parse(authorizationUrl)
    ) { activity, uri ->
        val intent = Intent(Intent.ACTION_VIEW, uri)
        activity.startActivity(intent)
    }
1

There are 1 best solutions below

0
On

You are confusing of declare attribute for deeplink. Read this for more information https://developer.android.com/training/app-links/deep-linking#adding-filters

          <data
            android:host="hello"
            android:pathPrefix="/success"
            android:scheme="com.example.success"/>