Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android Kotlin Auth.signOut(), customTab remains still open and has to be closed manually by user #1968

Closed
2 of 13 tasks
lokalathlet opened this issue Sep 19, 2022 · 32 comments
Closed
2 of 13 tasks
Assignees
Labels
auth Related to the Auth category/plugins bug Something isn't working

Comments

@lokalathlet
Copy link

Description

Hi all, I'm working on an android app in kotlin, using the Amplify authentication plugin. The user signs in by Auth.signInWithWebUI() api and finally signs out by calling Auth.signOut(). Everything works fine, except randomly within the signOut process the customTab remains still open and didn't close automatically. I'm using the latest version of auth plugin for android, Kotlin.

Categories

  • Analytics
  • API (REST)
  • API (GraphQL)
  • Auth
  • Authenticator
  • DataStore
  • Storage

Steps to Reproduce

  1. Auth.signInWithWebUI()
  2. Auth.signOut()

Screenshots

Bildschirmfoto 2022-09-19 um 07 57 09

Platforms

  • iOS
  • Android
  • Web
  • macOS
  • Windows
  • Linux

Android Device/Emulator API Level

API 32+

Environment

n/a

Dependencies

+--- com.amplifyframework:aws-auth-cognito:1.37.3
|    +--- com.amplifyframework:core:1.37.3 (*)
|    +--- androidx.appcompat:appcompat:1.2.0 -> 1.4.2 (*)
|    +--- com.amazonaws:aws-android-sdk-mobile-client:2.52.1
|    |    +--- com.amazonaws:aws-android-sdk-auth-core:2.52.1
|    |    |    \--- com.amazonaws:aws-android-sdk-core:2.52.1
|    |    |         +--- com.google.code.gson:gson:2.8.9 -> 2.9.0
|    |    |         \--- androidx.annotation:annotation:1.1.0 -> 1.3.0
|    |    +--- com.amazonaws:aws-android-sdk-cognitoidentityprovider:2.52.1
|    |    |    +--- com.amazonaws:aws-android-sdk-core:2.52.1 (*)
|    |    |    +--- com.amazonaws:aws-android-sdk-cognitoidentityprovider-asf:2.52.1
|    |    |    |    \--- com.amazonaws:aws-android-sdk-core:2.52.1 (*)
|    |    |    \--- androidx.annotation:annotation:1.1.0 -> 1.3.0
|    |    \--- androidx.core:core:1.3.1 -> 1.8.0 (*)
|    \--- com.amazonaws:aws-android-sdk-cognitoauth:2.52.1
|         +--- com.amazonaws:aws-android-sdk-core:2.52.1 (*)
|         +--- com.amazonaws:aws-android-sdk-cognitoidentityprovider-asf:2.52.1 (*)
|         \--- androidx.browser:browser:1.3.0
|              +--- androidx.core:core:1.1.0 -> 1.8.0 (*)
|              +--- androidx.annotation:annotation:1.1.0 -> 1.3.0
|              \--- com.google.guava:listenablefuture:1.0 -> 9999.0-empty-to-avoid-conflict-with-guava
+--- com.amplifyframework:core-kotlin:0.21.3
|    +--- org.jetbrains.kotlin:kotlin-stdlib:1.4.31 -> 1.7.10 (*)
|    +--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.2 -> 1.6.4 (*)
|    +--- androidx.core:core-ktx:1.3.2 -> 1.8.0 (*)
|    \--- com.amplifyframework:core:1.37.3 (*)
+--- aws.sdk.kotlin:cognitoidentityprovider:0.16.0
|    \--- aws.sdk.kotlin:cognitoidentityprovider-jvm:0.16.0
|         +--- org.jetbrains.kotlin:kotlin-stdlib:1.6.21 -> 1.7.10 (*)
|         +--- aws.sdk.kotlin:aws-config:0.16.0
|         |    \--- aws.sdk.kotlin:aws-config-jvm:0.16.0
|         |         +--- org.jetbrains.kotlin:kotlin-stdlib:1.6.21 -> 1.7.10 (*)
|         |         \--- aws.sdk.kotlin:aws-core:0.16.0
|         |              \--- aws.sdk.kotlin:aws-core-jvm:0.16.0
|         |                   +--- aws.smithy.kotlin:runtime-core:0.10.0
|         |                   |    \--- aws.smithy.kotlin:runtime-core-jvm:0.10.0
|         |                   |         +--- org.jetbrains.kotlin:kotlin-stdlib:1.6.21 -> 1.7.10 (*)
|         |                   |         +--- aws.smithy.kotlin:io:0.10.0
|         |                   |         |    \--- aws.smithy.kotlin:io-jvm:0.10.0
|         |                   |         |         \--- org.jetbrains.kotlin:kotlin-stdlib:1.6.21 -> 1.7.10 (*)
|         |                   |         +--- aws.smithy.kotlin:utils:0.10.0
|         |                   |         |    \--- aws.smithy.kotlin:utils-jvm:0.10.0
|         |                   |         |         \--- org.jetbrains.kotlin:kotlin-stdlib:1.6.21 -> 1.7.10 (*)
|         |                   |         \--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.1 -> 1.6.4 (*)
|         |                   \--- org.jetbrains.kotlin:kotlin-stdlib:1.6.21 -> 1.7.10 (*)
|         +--- aws.sdk.kotlin:aws-core:0.16.0 (*)
|         +--- aws.sdk.kotlin:aws-endpoint:0.16.0
|         |    \--- aws.sdk.kotlin:aws-endpoint-jvm:0.16.0
|         |         +--- org.jetbrains.kotlin:kotlin-stdlib:1.6.21 -> 1.7.10 (*)
|         |         +--- aws.smithy.kotlin:http:0.10.0
|         |         |    \--- aws.smithy.kotlin:http-jvm:0.10.0
|         |         |         +--- org.jetbrains.kotlin:kotlin-stdlib:1.6.21 -> 1.7.10 (*)
|         |         |         +--- aws.smithy.kotlin:runtime-core:0.10.0 (*)
|         |         |         +--- aws.smithy.kotlin:utils:0.10.0 (*)
|         |         |         +--- aws.smithy.kotlin:io:0.10.0 (*)
|         |         |         \--- org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.1 -> 1.6.4 (*)
|         |         \--- aws.smithy.kotlin:aws-signing-common:0.10.0
|         |              \--- aws.smithy.kotlin:aws-signing-common-jvm:0.10.0
|         |                   +--- aws.smithy.kotlin:aws-credentials:0.10.0
|         |                   |    \--- aws.smithy.kotlin:aws-credentials-jvm:0.10.0
|         |                   |         +--- aws.smithy.kotlin:runtime-core:0.10.0 (*)
|         |                   |         \--- org.jetbrains.kotlin:kotlin-stdlib:1.6.21 -> 1.7.10 (*)
|         |                   +--- aws.smithy.kotlin:http:0.10.0 (*)
|         |                   \--- org.jetbrains.kotlin:kotlin-stdlib:1.6.21 -> 1.7.10 (*)
|         \--- aws.smithy.kotlin:runtime-core:0.10.0 (*)
+--- aws.sdk.kotlin:cognitoidentity:0.16.0
|    \--- aws.sdk.kotlin:cognitoidentity-jvm:0.16.0
|         +--- org.jetbrains.kotlin:kotlin-stdlib:1.6.21 -> 1.7.10 (*)
|         +--- aws.sdk.kotlin:aws-config:0.16.0 (*)
|         +--- aws.sdk.kotlin:aws-core:0.16.0 (*)
|         +--- aws.sdk.kotlin:aws-endpoint:0.16.0 (*)
|         \--- aws.smithy.kotlin:runtime-core:0.10.0 (*)

Device

n/a

OS

n/a

Deployment Method

Custom Pipeline

CLI Version

n/a

Additional Context

No response

Amplify Config

n/a

@dnys1 dnys1 self-assigned this Sep 19, 2022
@dnys1 dnys1 added auth Related to the Auth category/plugins pending-triage Issue is pending triage labels Sep 19, 2022
@dnys1
Copy link
Contributor

dnys1 commented Sep 19, 2022

Hi @lokalathlet - sorry you are facing this issue. Would you be able to share any logs around the time this occurs?

@tylerjroach
Copy link
Member

@lokalathlet I think the first step is to look into your implementation of your sign out redirect uri? Could you post the activity block in your manifest that handles sign out? If this part was not implemented, please see here: https://docs.amplify.aws/lib/auth/social/q/platform/android/#update-androidmanifestxml

@tylerjroach tylerjroach self-assigned this Sep 19, 2022
@lokalathlet
Copy link
Author

lokalathlet commented Sep 20, 2022

Manifest:

<queries>
   ...
    <intent>
        <action android:name="android.intent.action.VIEW" />
        <data android:scheme="https" />
    </intent>
    <intent>
        <action android:name=
            "android.support.customtabs.action.CustomTabsService" />
    </intent>
</queries>
<application
    android:name="de.db.xxxx.SiBaApplication"
    android:allowBackup="false"
    android:fullBackupContent="false"
    android:dataExtractionRules="@xml/data_extraction_rules"
    android:icon="@mipmap/ic_launcher"
    tools:replace="android:icon"
    android:label="@string/app_name"
    android:roundIcon="@mipmap/ic_launcher"
    android:usesCleartextTraffic="false"
    android:networkSecurityConfig="@xml/network_security_config"
    android:supportsRtl="true"
    android:theme="@style/AppTheme"
    tools:targetApi="s">
    <activity
        android:name="de.db.xxxx.ui.MainActivity"
        android:screenOrientation="portrait"
        android:configChanges="orientation|screenSize"
        android:launchMode="singleTask"
        android:theme="@style/Theme.App.Starting"
        android:exported="true">
        <intent-filter >
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity
        android:name="com.amplifyframework.auth.cognito.activities.HostedUIRedirectActivity"
        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:scheme="sibaapp" />
        </intent-filter>
    </activity>
    <!--
    <activity
        android:name="de.db.xxxx.ui.LoginActivity"
        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:scheme="sibaapp" android:host="redirect"/>
        </intent-filter>
        </activity>
        <activity
        android:name="de.db.xxxx.ui.LogoutActivity"
        android:theme="@style/AppTheme"
        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:scheme="sibaapp" android:host="signout"/>
        </intent-filter>
    </activity>
    -->

Configuration Json:
`
{
"auth": {
"plugins": {
"awsCognitoAuthPlugin": {
"IdentityManager": {
"Default": {

      }
    },
    "CognitoUserPool": {
      "Default": {
        "PoolId": "$poolId",
        "AppClientId": "$clientId",
        "Region": "eu-central-1"
      }
    },
    "Auth": {
      "Default": {
        "authenticationFlowType": "$authenticationFlowType",
        "OAuth": {
          "WebDomain": "$webDomain",
          "AppClientId": "$clientId",
          "SignInRedirectURI": "sibaapp://redirect",
          "SignOutRedirectURI": "sibaapp://signout",
          "Scopes": [
            $scopes
          ]
        }
      }
    }
  }
}

}
}
`

@lokalathlet
Copy link
Author

Hi @lokalathlet - sorry you are facing this issue. Would you be able to share any logs around the time this occurs?

I try to fetchAuthSession to get the signedIn Status (is true here).

2022-09-20 18:52:51.611 27992-27992/de.db.xxxx.abn D/MainActivity: ::onActivityResult resultCode: 0 data: null
2022-09-20 18:52:51.620 27992-27992/de.db.xxxx.abn D/BackendImpl: :handleWebUISignInResponse received requestCode : 49281 and resultCode : 0
2022-09-20 18:52:51.647 27992-27992/de.db.xxxx.abn I/BackendImpl: Initiate Signout Sequence
2022-09-20 18:52:51.686 27992-3784/de.db.xxxx.abn D/AWSMobileClient: Inspecting user state details
2022-09-20 18:52:51.704 27992-3784/de.db.xxxx.abn D/AWSMobileClient: _hostedUISignIn without federation: Putting provider and token in store
2022-09-20 18:52:51.762 27992-27992/de.db.xxxx.abn D/BackendImpl: ::isSignedIn true
2022-09-20 18:52:51.770 27992-3787/de.db.xxxx.abn W/CognitoUserSession: CognitoUserSession is not valid because idToken is null.
2022-09-20 18:53:01.891 27992-27992/de.db.xxxx.abn E/BackendImpl: :signOut Sign out failed com.amazonaws.mobileconnectors.cognitoauth.exceptions.AuthServiceException: Timed out while waiting for sign-out redirect response.
2022-09-20 18:53:01.895 27992-27992/de.db.xxxx.abn I/ViewRootImpl@9048c19[MainActivity]: stopped(false) old=false
2022-09-20 18:53:01.896 27992-27992/de.db.xxxx.abn D/MainActivity: ::onResume
2022-09-20 18:53:01.900 27992-27992/de.db.xxxx.abn D/AppStatusHelper: ::isCustomTabsPackageAvailable chromeTabsAvailable:true, chromeInstalled: true, chromeEnabled: true
2022-09-20 18:53:01.900 27992-27992/de.db.xxxx.abn D/AmplifyAuthConfigurationHelperImpl: ::handleAlreadyConfiguredState: true

@tylerjroach
Copy link
Member

@lokalathlet SignOutRedirectURI of "elbaapp://signout" doesn't match "sibaapp://signout" defined in the manifest.

@lokalathlet
Copy link
Author

Hi @lokalathlet - sorry you are facing this issue. Would you be able to share any logs around the time this occurs?

Hi @dnys1 , this is another log, were the CustomTab didn't close.

2022-09-21 07:46:19.694 18939-19302/de.db.xxxx.abn D/IdentityManager: Signing out...
2022-09-21 07:46:19.696 18939-18939/de.db.xxxx.abn I/ViewRootImpl@b3a3707[CustomTabsManagerActivity]: dispatchDetachedFromWindow
2022-09-21 07:46:19.704 18939-19354/de.db.xxxx.abn D/AuthClient: Sign-out was successful.
2022-09-21 07:46:19.705 18939-18939/de.db.xxxx.abn D/InputTransport: Input channel destroyed: '433ee07', fd=132
2022-09-21 07:46:19.728 18939-18939/de.db.xxxx.abn D/AWSMobileClient: onSignout: HostedUI signed-out
2022-09-21 07:46:19.736 18939-18939/de.db.xxxx.abn D/AuthClient: CustomTabsManagerActivity was created with a null state.
2022-09-21 07:46:19.743 18939-18939/de.db.xxxx.abn I/DecorView: [INFO] isPopOver=false, config=true
2022-09-21 07:46:19.743 18939-18939/de.db.xxxx.abn I/DecorView: updateCaptionType >> DecorView@6f8eff7[], isFloating=false, isApplication=true, hasWindowControllerCallback=true, hasWindowDecorCaption=false
2022-09-21 07:46:19.743 18939-18939/de.db.xxxx.abn D/DecorView: setCaptionType = 0, this = DecorView@6f8eff7[]
2022-09-21 07:46:19.744 18939-18939/de.db.xxxx.abn I/DecorView: getCurrentDensityDpi: from real metrics. densityDpi=420 msg=resources_loaded
2022-09-21 07:46:19.803 18939-18939/de.db.xxxx.abn D/InsetsSourceConsumer: ensureControlAlpha: for ITYPE_NAVIGATION_BAR on de.db.xxxx.abn/de.db.xxxx.ui.MainActivity
2022-09-21 07:46:19.804 18939-18939/de.db.xxxx.abn D/InsetsSourceConsumer: ensureControlAlpha: for ITYPE_STATUS_BAR on de.db.xxxx.abn/de.db.xxxx.ui.MainActivity
2022-09-21 07:46:19.805 18939-19302/de.db.xxxx.abn D/AWSMobileClient: Inspecting user state details
2022-09-21 07:46:19.824 18939-18939/de.db.xxxx.abn I/BackendImpl: :signOut Signed out locally
2022-09-21 07:46:19.827 18939-18939/de.db.xxxx.abn D/BackendImpl: :updateUserData false
2022-09-21 07:46:19.830 18939-18939/de.db.xxxx.abn I/BackendImpl$subcribeToHubChannelAUTH: Amplify.Hub SIGNED_OUT
2022-09-21 07:46:20.024 18939-18939/de.db.xxxx.abn D/InputTransport: Input channel destroyed: 'ClientS', fd=133
2022-09-21 07:46:20.405 18939-18939/de.db.xxxx.abn I/ViewRootImpl@652918c[MainActivity]: handleAppVisibility mAppVisible=true visible=false
2022-09-21 07:46:20.416 18939-18974/de.db.xxxx.abn D/OpenGLRenderer: setSurface called with nullptr
2022-09-21 07:46:20.416 18939-18974/de.db.xxxx.abn D/OpenGLRenderer: setSurface() destroyed EGLSurface
2022-09-21 07:46:20.416 18939-18974/de.db.xxxx.abn D/OpenGLRenderer: destroyEglSurface
2022-09-21 07:46:20.431 18939-18939/de.db.xxxx.abn I/ViewRootImpl@652918c[MainActivity]: Relayout returned: old=(0,0,1080,2400) new=(0,0,1080,2400) req=(1080,2400)8 dur=8 res=0x5 s={false 0} ch=true fn=241
2022-09-21 07:46:20.434 18939-18939/de.db.xxxx.abn I/ViewRootImpl@652918c[MainActivity]: stopped(true) old=false

@lokalathlet
Copy link
Author

Hi @tylerjroach, you're right, but i just missed to rename it in the snipped.

@abdallahshaban557
Copy link

Moving this to the Android repository. FYI @lokalathlet @tylerjroach

@abdallahshaban557 abdallahshaban557 transferred this issue from aws-amplify/amplify-flutter Sep 21, 2022
@lokalathlet
Copy link
Author

another log

2022-09-22 08:36:40.678 6244-6244/de.db.xxxx.test I/Dialog: mIsDeviceDefault = false, mIsSamsungBasicInteraction = false, isMetaDataInActivity = false
2022-09-22 08:36:40.681 6244-6244/de.db.xxxx.test I/DecorView: [INFO] isPopOver=false, config=false
2022-09-22 08:36:40.682 6244-6244/de.db.xxxx.test I/DecorView: updateCaptionType >> DecorView@2c3f122[], isFloating=true, isApplication=true, hasWindowControllerCallback=false, hasWindowDecorCaption=false
2022-09-22 08:36:40.682 6244-6244/de.db.xxxx.test D/DecorView: setCaptionType = 0, this = DecorView@2c3f122[]
2022-09-22 08:36:40.698 6244-6244/de.db.xxxx.test D/ScrollView: initGoToTop
2022-09-22 08:36:40.719 6244-6244/de.db.xxxx.test I/ViewRootImpl@15716a0[MainActivity]: setView = com.android.internal.policy.DecorView@2c3f122 TM=true
2022-09-22 08:36:40.720 6244-6244/de.db.xxxx.test I/BackendImpl: Initiate Signout Sequence
2022-09-22 08:36:40.737 6244-6244/de.db.xxxx.test D/InsetsSourceConsumer: ensureControlAlpha: for ITYPE_NAVIGATION_BAR on de.db.xxxx.test/de.db.xxxx.ui.MainActivity
2022-09-22 08:36:40.738 6244-6244/de.db.xxxx.test D/InsetsSourceConsumer: ensureControlAlpha: for ITYPE_STATUS_BAR on de.db.xxxx.test/de.db.xxxx.ui.MainActivity
2022-09-22 08:36:40.738 6244-6244/de.db.xxxx.test I/ViewRootImpl@15716a0[MainActivity]: Relayout returned: old=(0,88,1080,2274) new=(28,760,1052,1601) req=(1024,841)0 dur=8 res=0x7 s={true -5476376629481221216} ch=true fn=-1
2022-09-22 08:36:40.739 6244-6287/de.db.xxxx.test D/OpenGLRenderer: eglCreateWindowSurface
2022-09-22 08:36:40.741 6244-6244/de.db.xxxx.test D/ScrollView: onsize change changed
2022-09-22 08:36:40.742 6244-6244/de.db.xxxx.test I/ViewRootImpl@15716a0[MainActivity]: [DP] dp(1) 1 android.view.ViewRootImpl.reportNextDraw:11442 android.view.ViewRootImpl.performTraversals:4198 android.view.ViewRootImpl.doTraversal:2924
2022-09-22 08:36:40.742 6244-6244/de.db.xxxx.test D/ViewRootImpl@15716a0[MainActivity]: Creating frameDrawingCallback nextDrawUseBlastSync=false reportNextDraw=true hasBlurUpdates=false
2022-09-22 08:36:40.742 6244-6244/de.db.xxxx.test D/ViewRootImpl@15716a0[MainActivity]: Creating frameCompleteCallback
2022-09-22 08:36:40.744 6244-8964/de.db.xxxx.test D/AWSMobileClient: Inspecting user state details
2022-09-22 08:36:40.745 6244-6306/de.db.xxxx.test D/ViewRootImpl@15716a0[MainActivity]: Received frameDrawingCallback frameNum=1. Creating transactionCompleteCallback=false
2022-09-22 08:36:40.746 6244-6287/de.db.xxxx.test I/BufferQueueProducer: ViewRootImpl@15716a0[MainActivity]#12(BLAST Consumer)12 queueBuffer: queued for the first time.
2022-09-22 08:36:40.747 6244-6287/de.db.xxxx.test D/ViewRootImpl@15716a0[MainActivity]: Received frameCompleteCallback lastAcquiredFrameNum=1 lastAttemptedDrawFrameNum=1
2022-09-22 08:36:40.749 6244-6244/de.db.xxxx.test I/ViewRootImpl@15716a0[MainActivity]: [DP] pdf(0) 1 android.view.ViewRootImpl.lambda$addFrameCompleteCallbackIfNeeded$3$ViewRootImpl:5000 android.view.ViewRootImpl$$ExternalSyntheticLambda16.run:6 android.os.Handler.handleCallback:938
2022-09-22 08:36:40.749 6244-6244/de.db.xxxx.test I/ViewRootImpl@15716a0[MainActivity]: [DP] rdf()
2022-09-22 08:36:40.749 6244-6244/de.db.xxxx.test D/ViewRootImpl@15716a0[MainActivity]: reportDrawFinished (fn: -1)
2022-09-22 08:36:40.752 6244-6244/de.db.xxxx.test I/ViewRootImpl@5ea96bc[MainActivity]: MSG_WINDOW_FOCUS_CHANGED 0 1
2022-09-22 08:36:40.768 6244-6244/de.db.xxxx.test I/ViewRootImpl@15716a0[MainActivity]: MSG_WINDOW_FOCUS_CHANGED 1 1
2022-09-22 08:36:40.780 6244-8964/de.db.xxxx.test D/AWSMobileClient: hasFederatedToken: false provider: cognito-idp.eu-central-1.amazonaws.com/eu-central-1_XXXXXXX
2022-09-22 08:36:40.806 6244-6244/de.db.xxxx.test D/BackendImpl: ::isSignedIn true
2022-09-22 08:36:40.806 6244-6257/de.db.xxxx.test I/.xxxx.tes: Compiler allocated 4148KB to compile void android.widget.TextView.(android.content.Context, android.util.AttributeSet, int, int)
2022-09-22 08:36:40.973 6244-6244/de.db.xxxx.test I/DecorView: [INFO] isPopOver=false, config=true
2022-09-22 08:36:40.973 6244-6244/de.db.xxxx.test I/DecorView: updateCaptionType >> DecorView@62d67d0[], isFloating=false, isApplication=true, hasWindowControllerCallback=true, hasWindowDecorCaption=false
2022-09-22 08:36:40.973 6244-6244/de.db.xxxx.test D/DecorView: setCaptionType = 0, this = DecorView@62d67d0[]
2022-09-22 08:36:40.974 6244-6244/de.db.xxxx.test I/DecorView: getCurrentDensityDpi: from real metrics. densityDpi=420 msg=resources_loaded
2022-09-22 08:36:40.998 6244-6244/de.db.xxxx.test I/ViewRootImpl@e8ecace[CustomTabsManagerActivity]: setView = com.android.internal.policy.DecorView@62d67d0 TM=true
2022-09-22 08:36:41.000 6244-6244/de.db.xxxx.test D/InsetsSourceConsumer: ensureControlAlpha: for ITYPE_NAVIGATION_BAR on de.db.xxxx.test/de.db.xxxx.ui.MainActivity
2022-09-22 08:36:41.000 6244-6244/de.db.xxxx.test D/InsetsSourceConsumer: ensureControlAlpha: for ITYPE_STATUS_BAR on de.db.xxxx.test/de.db.xxxx.ui.MainActivity
2022-09-22 08:36:41.022 6244-6244/de.db.xxxx.test I/ViewRootImpl@e8ecace[CustomTabsManagerActivity]: Relayout returned: old=(0,0,1080,2400) new=(0,0,1080,2400) req=(1080,2400)0 dur=6 res=0x7 s={true -5476376629481256096} ch=true fn=-1
2022-09-22 08:36:41.023 6244-6287/de.db.xxxx.test D/OpenGLRenderer: eglCreateWindowSurface
2022-09-22 08:36:41.024 6244-6244/de.db.xxxx.test I/ViewRootImpl@e8ecace[CustomTabsManagerActivity]: [DP] dp(1) 1 android.view.ViewRootImpl.reportNextDraw:11442 android.view.ViewRootImpl.performTraversals:4198 android.view.ViewRootImpl.doTraversal:2924
2022-09-22 08:36:41.024 6244-6244/de.db.xxxx.test D/ViewRootImpl@e8ecace[CustomTabsManagerActivity]: Creating frameDrawingCallback nextDrawUseBlastSync=false reportNextDraw=true hasBlurUpdates=false
2022-09-22 08:36:41.024 6244-6244/de.db.xxxx.test D/ViewRootImpl@e8ecace[CustomTabsManagerActivity]: Creating frameCompleteCallback
2022-09-22 08:36:41.026 6244-6307/de.db.xxxx.test D/ViewRootImpl@e8ecace[CustomTabsManagerActivity]: Received frameDrawingCallback frameNum=1. Creating transactionCompleteCallback=false
2022-09-22 08:36:41.028 6244-6287/de.db.xxxx.test I/BufferQueueProducer: ViewRootImpl@e8ecace[CustomTabsManagerActivity]#13(BLAST Consumer)13 queueBuffer: queued for the first time.
2022-09-22 08:36:41.029 6244-6287/de.db.xxxx.test D/ViewRootImpl@e8ecace[CustomTabsManagerActivity]: Received frameCompleteCallback lastAcquiredFrameNum=1 lastAttemptedDrawFrameNum=1
2022-09-22 08:36:41.030 6244-6244/de.db.xxxx.test I/ViewRootImpl@e8ecace[CustomTabsManagerActivity]: [DP] pdf(0) 1 android.view.ViewRootImpl.lambda$addFrameCompleteCallbackIfNeeded$3$ViewRootImpl:5000 android.view.ViewRootImpl$$ExternalSyntheticLambda16.run:6 android.os.Handler.handleCallback:938
2022-09-22 08:36:41.030 6244-6244/de.db.xxxx.test I/ViewRootImpl@e8ecace[CustomTabsManagerActivity]: [DP] rdf()
2022-09-22 08:36:41.030 6244-6244/de.db.xxxx.test D/ViewRootImpl@e8ecace[CustomTabsManagerActivity]: reportDrawFinished (fn: -1)
2022-09-22 08:36:41.117 6244-6244/de.db.xxxx.test I/ViewRootImpl@15716a0[MainActivity]: MSG_WINDOW_FOCUS_CHANGED 0 1
2022-09-22 08:36:41.394 6244-6244/de.db.xxxx.test I/DecorView: [INFO] isPopOver=false, config=true
2022-09-22 08:36:41.395 6244-6244/de.db.xxxx.test I/DecorView: updateCaptionType >> DecorView@9a90be7[], isFloating=false, isApplication=true, hasWindowControllerCallback=true, hasWindowDecorCaption=false
2022-09-22 08:36:41.395 6244-6244/de.db.xxxx.test D/DecorView: setCaptionType = 0, this = DecorView@9a90be7[]
2022-09-22 08:36:41.396 6244-6244/de.db.xxxx.test I/DecorView: getCurrentDensityDpi: from real metrics. densityDpi=420 msg=resources_loaded
2022-09-22 08:36:41.401 6244-6244/de.db.xxxx.test D/InsetsSourceConsumer: ensureControlAlpha: for ITYPE_NAVIGATION_BAR on de.db.xxxx.test/de.db.xxxx.ui.MainActivity
2022-09-22 08:36:41.402 6244-6244/de.db.xxxx.test D/InsetsSourceConsumer: ensureControlAlpha: for ITYPE_STATUS_BAR on de.db.xxxx.test/de.db.xxxx.ui.MainActivity
2022-09-22 08:36:41.403 6244-9017/de.db.xxxx.test D/AuthClient: Sign-out was successful.
2022-09-22 08:36:41.403 6244-6244/de.db.xxxx.test I/ViewRootImpl@e8ecace[CustomTabsManagerActivity]: stopped(true) old=false
2022-09-22 08:36:41.408 6244-8969/de.db.xxxx.test D/IdentityManager: Signing out...
2022-09-22 08:36:41.452 6244-6287/de.db.xxxx.test D/OpenGLRenderer: setSurface called with nullptr
2022-09-22 08:36:41.452 6244-6287/de.db.xxxx.test D/OpenGLRenderer: setSurface() destroyed EGLSurface
2022-09-22 08:36:41.452 6244-6287/de.db.xxxx.test D/OpenGLRenderer: destroyEglSurface
2022-09-22 08:36:41.453 6244-6244/de.db.xxxx.test I/ViewRootImpl@e8ecace[CustomTabsManagerActivity]: dispatchDetachedFromWindow
2022-09-22 08:36:41.461 6244-6244/de.db.xxxx.test D/InputTransport: Input channel destroyed: '24b740d', fd=172
2022-09-22 08:36:41.481 6244-6244/de.db.xxxx.test D/AWSMobileClient: onSignout: HostedUI signed-out
2022-09-22 08:36:41.483 6244-8969/de.db.xxxx.test D/AWSMobileClient: Inspecting user state details
2022-09-22 08:36:41.490 6244-6244/de.db.xxxx.test D/AuthClient: CustomTabsManagerActivity was created with a null state.
2022-09-22 08:36:41.495 6244-6244/de.db.xxxx.test I/DecorView: [INFO] isPopOver=false, config=true
2022-09-22 08:36:41.495 6244-6244/de.db.xxxx.test I/DecorView: updateCaptionType >> DecorView@4f4a7f5[], isFloating=false, isApplication=true, hasWindowControllerCallback=true, hasWindowDecorCaption=false
2022-09-22 08:36:41.495 6244-6244/de.db.xxxx.test D/DecorView: setCaptionType = 0, this = DecorView@4f4a7f5[]
2022-09-22 08:36:41.496 6244-6244/de.db.xxxx.test I/DecorView: getCurrentDensityDpi: from real metrics. densityDpi=420 msg=resources_loaded
2022-09-22 08:36:41.498 6244-6244/de.db.xxxx.test I/BackendImpl: :signOut Signed out locally
2022-09-22 08:36:41.510 6244-6244/de.db.xxxx.test D/BackendImpl: :updateUserData false
2022-09-22 08:36:41.511 6244-6244/de.db.xxxx.test I/BackendImpl$subcribeToHubChannelAUTH: Amplify.Hub SIGNED_OUT
2022-09-22 08:36:41.681 6244-6244/de.db.xxxx.test D/InputTransport: Input channel destroyed: 'ClientS', fd=141
2022-09-22 08:36:42.072 6244-6244/de.db.xxxx.test I/ViewRootImpl@15716a0[MainActivity]: handleAppVisibility mAppVisible=true visible=false
2022-09-22 08:36:42.080 6244-6287/de.db.xxxx.test D/OpenGLRenderer: setSurface called with nullptr
2022-09-22 08:36:42.080 6244-6287/de.db.xxxx.test D/OpenGLRenderer: setSurface() destroyed EGLSurface
2022-09-22 08:36:42.080 6244-6287/de.db.xxxx.test D/OpenGLRenderer: destroyEglSurface
2022-09-22 08:36:42.096 6244-6244/de.db.xxxx.test I/ViewRootImpl@15716a0[MainActivity]: Relayout returned: old=(28,760,1052,1601) new=(28,760,1052,1601) req=(1024,841)8 dur=11 res=0x5 s={false 0} ch=true fn=2
2022-09-22 08:36:42.096 6244-6244/de.db.xxxx.test I/ViewRootImpl@5ea96bc[MainActivity]: handleAppVisibility mAppVisible=true visible=false
2022-09-22 08:36:42.098 6244-6244/de.db.xxxx.test I/ViewRootImpl@15716a0[MainActivity]: stopped(true) old=false
2022-09-22 08:36:42.099 6244-6244/de.db.xxxx.test I/ViewRootImpl@5ea96bc[MainActivity]: stopped(true) old=false
2022-09-22 08:36:42.115 6244-6287/de.db.xxxx.test D/OpenGLRenderer: setSurface called with nullptr
2022-09-22 08:36:42.115 6244-6287/de.db.xxxx.test D/OpenGLRenderer: setSurface() destroyed EGLSurface
2022-09-22 08:36:42.115 6244-6287/de.db.xxxx.test D/OpenGLRenderer: destroyEglSurface
2022-09-22 08:36:42.126 6244-6244/de.db.xxxx.test I/ViewRootImpl@5ea96bc[MainActivity]: Relayout returned: old=(0,0,1080,2400) new=(0,0,1080,2400) req=(1080,2400)8 dur=6 res=0x5 s={false 0} ch=false fn=-1
2022-09-22 08:36:47.197 6244-6287/de.db.xxxx.test D/OpenGLRenderer: setSurface called with nullptr
2022-09-22 08:36:47.201 6244-6287/de.db.xxxx.test D/OpenGLRenderer: setSurface called with nullptr
2022-09-22 08:36:47.214 6244-6244/de.db.xxxx.test I/ViewRootImpl@15716a0[MainActivity]: handleAppVisibility mAppVisible=false visible=true
2022-09-22 08:36:47.214 6244-6244/de.db.xxxx.test I/ViewRootImpl@5ea96bc[MainActivity]: handleAppVisibility mAppVisible=false visible=true
2022-09-22 08:36:47.244 6244-6244/de.db.xxxx.test I/ViewRootImpl@15716a0[MainActivity]: Relayout returned: old=(28,760,1052,1601) new=(28,760,1052,1601) req=(1024,841)0 dur=25 res=0x7 s={true -5476376629481221216} ch=true fn=-1
2022-09-22 08:36:47.245 6244-6287/de.db.xxxx.test D/OpenGLRenderer: eglCreateWindowSurface
2022-09-22 08:36:47.246 6244-6244/de.db.xxxx.test I/ViewRootImpl@15716a0[MainActivity]: [DP] dp(1) 1 android.view.ViewRootImpl.reportNextDraw:11442 android.view.ViewRootImpl.performTraversals:4198 android.view.ViewRootImpl.doTraversal:2924
2022-09-22 08:36:47.246 6244-6244/de.db.xxxx.test D/ViewRootImpl@15716a0[MainActivity]: Creating frameDrawingCallback nextDrawUseBlastSync=false reportNextDraw=true hasBlurUpdates=false
2022-09-22 08:36:47.246 6244-6244/de.db.xxxx.test D/ViewRootImpl@15716a0[MainActivity]: Creating frameCompleteCallback
2022-09-22 08:36:47.252 6244-6287/de.db.xxxx.test I/BufferQueueProducer: ViewRootImpl@15716a0[MainActivity]#14(BLAST Consumer)14 queueBuffer: queued for the first time.
2022-09-22 08:36:47.254 6244-6306/de.db.xxxx.test D/ViewRootImpl@15716a0[MainActivity]: Received frameDrawingCallback frameNum=2. Creating transactionCompleteCallback=false
2022-09-22 08:36:47.254 6244-6287/de.db.xxxx.test D/ViewRootImpl@15716a0[MainActivity]: Received frameCompleteCallback lastAcquiredFrameNum=1 lastAttemptedDrawFrameNum=2
2022-09-22 08:36:47.257 6244-6287/de.db.xxxx.test D/OpenGLRenderer: setSurface called with nullptr
2022-09-22 08:36:47.267 6244-6244/de.db.xxxx.test I/ViewRootImpl@5ea96bc[MainActivity]: Relayout returned: old=(0,0,1080,2400) new=(0,0,1080,2400) req=(1080,2400)4 dur=7 res=0x1 s={false 0} ch=false fn=-1
2022-09-22 08:36:47.268 6244-6244/de.db.xxxx.test I/ViewRootImpl@15716a0[MainActivity]: [DP] pdf(0) 1 android.view.ViewRootImpl.lambda$addFrameCompleteCallbackIfNeeded$3$ViewRootImpl:5000 android.view.ViewRootImpl$$ExternalSyntheticLambda16.run:6 android.os.Handler.handleCallback:938
2022-09-22 08:36:47.268 6244-6244/de.db.xxxx.test I/ViewRootImpl@15716a0[MainActivity]: [DP] rdf()
2022-09-22 08:36:47.268 6244-6244/de.db.xxxx.test D/ViewRootImpl@15716a0[MainActivity]: reportDrawFinished (fn: -1)
2022-09-22 08:36:47.268 6244-6244/de.db.xxxx.test D/ViewRootImpl@15716a0[MainActivity]: Scheduling a traversal=false due to a previous skipped traversal.
2022-09-22 08:36:47.269 6244-6244/de.db.xxxx.test I/ViewRootImpl@15716a0[MainActivity]: stopped(false) old=true
2022-09-22 08:36:47.269 6244-6244/de.db.xxxx.test I/ViewRootImpl@5ea96bc[MainActivity]: stopped(false) old=true
2022-09-22 08:36:47.274 6244-6244/de.db.xxxx.test I/ViewRootImpl@15716a0[MainActivity]: stopped(false) old=false
2022-09-22 08:36:47.274 6244-6244/de.db.xxxx.test I/ViewRootImpl@5ea96bc[MainActivity]: stopped(false) old=false
2022-09-22 08:36:47.275 6244-6244/de.db.xxxx.test D/MainActivity: ::onResume
2022-09-22 08:36:47.284 6244-6244/de.db.xxxx.test D/AppStatusHelper: ::isCustomTabsPackageAvailable chromeTabsAvailable:true, chromeInstalled: true, chromeEnabled: true
2022-09-22 08:36:47.286 6244-6244/de.db.xxxx.test D/AmplifyAuthConfigurationHelperImpl: ::handleAlreadyConfiguredState: true
2022-09-22 08:36:47.291 6244-6244/de.db.xxxx.test D/InsetsSourceConsumer: ensureControlAlpha: for ITYPE_NAVIGATION_BAR on de.db.xxxx.test/de.db.xxxx.ui.MainActivity
2022-09-22 08:36:47.292 6244-6244/de.db.xxxx.test D/InsetsSourceConsumer: ensureControlAlpha: for ITYPE_STATUS_BAR on de.db.xxxx.test/de.db.xxxx.ui.MainActivity
2022-09-22 08:36:47.293 6244-6287/de.db.xxxx.test D/OpenGLRenderer: setSurface called with nullptr
2022-09-22 08:36:47.293 6244-6287/de.db.xxxx.test D/OpenGLRenderer: setSurface() destroyed EGLSurface
2022-09-22 08:36:47.293 6244-6287/de.db.xxxx.test D/OpenGLRenderer: destroyEglSurface
2022-09-22 08:36:47.303 6244-6244/de.db.xxxx.test I/ViewRootImpl@15716a0[MainActivity]: Relayout returned: old=(28,760,1052,1601) new=(28,760,1052,1601) req=(1024,841)0 dur=7 res=0x1 s={true -5476376629481221216} ch=false fn=3
2022-09-22 08:36:47.304 6244-6287/de.db.xxxx.test D/OpenGLRenderer: setSurface called with nullptr
2022-09-22 08:36:47.316 6244-6244/de.db.xxxx.test I/ViewRootImpl@5ea96bc[MainActivity]: Relayout returned: old=(0,0,1080,2400) new=(0,0,1080,2400) req=(1080,2400)0 dur=9 res=0x7 s={true -5476376629481203776} ch=true fn=-1
2022-09-22 08:36:47.316 6244-6287/de.db.xxxx.test D/OpenGLRenderer: eglCreateWindowSurface
2022-09-22 08:36:47.317 6244-6244/de.db.xxxx.test I/ViewRootImpl@5ea96bc[MainActivity]: [DP] dp(1) 1 android.view.ViewRootImpl.reportNextDraw:11442 android.view.ViewRootImpl.performTraversals:4198 android.view.ViewRootImpl.doTraversal:2924
2022-09-22 08:36:47.318 6244-6244/de.db.xxxx.test D/ViewRootImpl@5ea96bc[MainActivity]: Creating frameDrawingCallback nextDrawUseBlastSync=false reportNextDraw=true hasBlurUpdates=false
2022-09-22 08:36:47.318 6244-6244/de.db.xxxx.test D/ViewRootImpl@5ea96bc[MainActivity]: Creating frameCompleteCallback
2022-09-22 08:36:47.324 6244-6307/de.db.xxxx.test D/ViewRootImpl@5ea96bc[MainActivity]: Received frameDrawingCallback frameNum=1. Creating transactionCompleteCallback=false
2022-09-22 08:36:47.324 6244-6287/de.db.xxxx.test I/BufferQueueProducer: ViewRootImpl@5ea96bc[MainActivity]#15(BLAST Consumer)15 queueBuffer: queued for the first time.
2022-09-22 08:36:47.325 6244-6287/de.db.xxxx.test D/ViewRootImpl@5ea96bc[MainActivity]: Received frameCompleteCallback lastAcquiredFrameNum=1 lastAttemptedDrawFrameNum=1
2022-09-22 08:36:47.325 6244-6244/de.db.xxxx.test I/ViewRootImpl@5ea96bc[MainActivity]: [DP] pdf(0) 1 android.view.ViewRootImpl.lambda$addFrameCompleteCallbackIfNeeded$3$ViewRootImpl:5000 android.view.ViewRootImpl$$ExternalSyntheticLambda16.run:6 android.os.Handler.handleCallback:938
2022-09-22 08:36:47.325 6244-6244/de.db.xxxx.test I/ViewRootImpl@5ea96bc[MainActivity]: [DP] rdf()
2022-09-22 08:36:47.325 6244-6244/de.db.xxxx.test D/ViewRootImpl@5ea96bc[MainActivity]: reportDrawFinished (fn: -1)
2022-09-22 08:36:47.337 6244-6244/de.db.xxxx.test D/MainActivity$onResume: ZeitBuchungUploadWorker.enqueuePeriodicWorkRequest all 360 minutes
2022-09-22 08:36:47.364 6244-6244/de.db.xxxx.test I/ViewRootImpl@15716a0[MainActivity]: MSG_WINDOW_FOCUS_CHANGED 1 1
2022-09-22 08:36:47.365 6244-6287/de.db.xxxx.test D/OpenGLRenderer: eglCreateWindowSurface
2022-09-22 08:36:49.435 6244-6244/de.db.xxxx.test I/ViewRootImpl@15716a0[MainActivity]: ViewPostIme pointer 0
2022-09-22 08:36:49.534 6244-6244/de.db.xxxx.test I/ViewRootImpl@15716a0[MainActivity]: ViewPostIme pointer 1
2022-09-22 08:36:49.546 6244-6287/de.db.xxxx.test I/BufferQueueProducer: ViewRootImpl@15716a0[MainActivity]#14(BLAST Consumer)14 queueBuffer: queued for the first time.
2022-09-22 08:36:49.550 6244-6287/de.db.xxxx.test D/OpenGLRenderer: setSurface called with nullptr
2022-09-22 08:36:49.550 6244-6287/de.db.xxxx.test D/OpenGLRenderer: setSurface() destroyed EGLSurface
2022-09-22 08:36:49.550 6244-6287/de.db.xxxx.test D/OpenGLRenderer: destroyEglSurface
2022-09-22 08:36:49.552 6244-6287/de.db.xxxx.test D/OpenGLRenderer: endAllActiveAnimators on 0xb4000078078ab600 (RippleDrawable) with handle 0xb400007717873ce0
2022-09-22 08:36:49.553 6244-6244/de.db.xxxx.test I/ViewRootImpl@15716a0[MainActivity]: dispatchDetachedFromWindow
2022-09-22 08:36:49.570 6244-6244/de.db.xxxx.test D/InputTransport: Input channel destroyed: '869b130', fd=113
2022-09-22 08:36:49.618 6244-6244/de.db.xxxx.test D/InsetsSourceConsumer: ensureControlAlpha: for ITYPE_NAVIGATION_BAR on de.db.xxxx.test/de.db.xxxx.ui.MainActivity
2022-09-22 08:36:49.621 6244-6244/de.db.xxxx.test D/InsetsSourceConsumer: ensureControlAlpha: for ITYPE_STATUS_BAR on de.db.xxxx.test/de.db.xxxx.ui.MainActivity
2022-09-22 08:36:50.018 6244-6244/de.db.xxxx.test I/ViewRootImpl@5ea96bc[MainActivity]: handleAppVisibility mAppVisible=true visible=false
2022-09-22 08:36:50.028 6244-6287/de.db.xxxx.test D/OpenGLRenderer: setSurface called with nullptr
2022-09-22 08:36:50.028 6244-6287/de.db.xxxx.test D/OpenGLRenderer: setSurface() destroyed EGLSurface
2022-09-22 08:36:50.028 6244-6287/de.db.xxxx.test D/OpenGLRenderer: destroyEglSurface
2022-09-22 08:36:50.040 6244-6244/de.db.xxxx.test I/ViewRootImpl@5ea96bc[MainActivity]: Relayout returned: old=(0,0,1080,2400) new=(0,0,1080,2400) req=(1080,2400)8 dur=5 res=0x5 s={false 0} ch=true fn=2
2022-09-22 08:36:50.042 6244-6244/de.db.xxxx.test I/ViewRootImpl@5ea96bc[MainActivity]: stopped(true) old=false
2022-09-22 08:36:50.088 6244-6287/de.db.xxxx.test D/OpenGLRenderer: setSurface called with nullptr
2022-09-22 08:36:50.088 6244-6244/de.db.xxxx.test I/ViewRootImpl@5ea96bc[MainActivity]: dispatchDetachedFromWindow
2022-09-22 08:36:50.094 6244-6244/de.db.xxxx.test D/InputTransport: Input channel destroyed: 'bce5094', fd=109

@tylerjroach
Copy link
Member

@lokalathlet I want to confirm that this is happening 100% of the time for you, correct? This would indicate that there is still a problem in the signout callback flow.

Are you doing custom sign out work in your SignOutActivity? If not, that activity shouldn't be needed and you can allow HostedUIRedirectActivity to do the work.

@lokalathlet
Copy link
Author

@lokalathlet I want to confirm that this is happening 100% of the time for you, correct? This would indicate that there is still a problem in the signout callback flow.

Are you doing custom sign out work in your SignOutActivity? If not, that activity shouldn't be needed and you can allow HostedUIRedirectActivity to do the work.

Hi @tylerroach thank you for your reply. I use HostedUIRedirectActivity only (as documented) and the custom tab remains open randomly (10 %).

@tylerjroach
Copy link
Member

Thank you for your reply. I didn't realize it was working most of the time, (indicating that your redirect configuration is likely correct). I, or someone on my team, will try to replicate.

@eeatonaws eeatonaws added bug Something isn't working and removed pending-triage Issue is pending triage labels Sep 27, 2022
@sdhuka sdhuka assigned dengdan154 and unassigned tylerjroach and dnys1 Oct 27, 2022
@dengdan154
Copy link
Contributor

dengdan154 commented Oct 28, 2022

Hi @lokalathlet, I have looked into this issue and currently cannot reproduce this behavior. Does your app use multiple login methods (Such as hosted UI, api based sign in etc.) or just this single one?

@miszmaniac
Copy link

I have a question regarding this. I wonder why app needs to display full screen CustomTab at first place?
This is really ugly UX experience.

@lokalathlet
Copy link
Author

Hi @lokalathlet, I have looked into this issue and currently cannot reproduce this behavior. Does your app use multiple login methods (Such as hosted UI, api based sign in etc.) or just this single one?

That is my problem, too. I have five different SmartPhones on my desk. Everyone shows this behaviour from time to time. Not deterministic at all.

@lokalathlet
Copy link
Author

I have a question regarding this. I wonder why app needs to display full screen CustomTab at first place? This is really ugly UX experience.

To whom you are asking this? I'm using just the API. Otherwise my plan is to migrate to a native solution. Eliminating the HostedUi way of authorize the user. But for the first step it saves a lot of time and code. But I agree to you. It is not the best user experience.

@tylerjroach
Copy link
Member

@lokalathlet, I still don't have an answer for you on why the redirect is failing for you around 10% of the time but I do see some issues here. Let's try to resolve this 1 step at a time.

We will be working on updating the HostedUI Sign Out documentation, especially around the suggestion to add a custom Sign Out redirect activity. The documentation is missing a step that if you implement a custom sign out activity, you must manually pass AWSMobileClient.getInstance().handleAuthResponse(getIntent()); to continue the sign out process on Amplify. I can see the evidence of this issue with the provided log

AuthServiceException: Timed out while waiting for sign-out redirect response.

I would suggest that the custom intent-filters for sign in and sign out are removed, allowing HostedUIRedirectActivity to control the processes.

Please reply back once this change is made with information on if you are still seeing the issue or not.

@lokalathlet
Copy link
Author

lokalathlet commented Nov 8, 2022

Hi @tylerjroach, my AndroidManifest.xml currently doesn't contain any custom sign in or out Activity configurations. Nevertheless I can see the issue.

<queries>
   ..
    <intent>
        <action android:name="android.intent.action.VIEW" />
        <data android:scheme="https" />
    </intent>
    <intent>
        <action android:name=
            "android.support.customtabs.action.CustomTabsService" />
    </intent>
</queries>
<application ..
<activity
        android:name="com.amplifyframework.auth.cognito.activities.HostedUIRedirectActivity"
        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:scheme="sibaapp" />
        </intent-filter>
    </activity>

@tylerjroach
Copy link
Member

@lokalathlet Thank you, thats great to know. It's possible that we are then seeing the timeouts because the redirect isn't happening (the reason the page remains open). This would appear to an issue such as the cognito url request hanging and the custom tab never redirecting back, but I would expect to see more reports of this if it were a common issue. Have you observed this issue happening with a specific browser (your screenshot appears to be Chrome).?

@lokalathlet
Copy link
Author

lokalathlet commented Nov 9, 2022

@tylerjroach the app force the user using chrome custom tab. Any Idea about to handle a hanging request or missing redirect back to the apps Activity. Who is responsible to handle these issues? I can't close the custom tab out of the app.

@tylerjroach
Copy link
Member

Are you explicitly setting the browser package to Chrome? A CustomTab supports more than just Chrome. By default, a CustomTab will launch with the users default browser. Was curious if you were observing any different behaviors depending on the browser. Are you observing this issue often in testing, or are you primarily seeing these issues on a logging tool?

@lokalathlet
Copy link
Author

@tylerjroach My assumption was, that the default is set to the Chrome package if not set.

    * @param browserPackage Specify which browser package should be used for web sign in (e.g. "org.mozilla.firefox").
     *                       Defaults to the Chrome package if not specified.

I observing the issue during testing.

@tylerjroach
Copy link
Member

@lokalathlet I've been able to finally replicate what you are reporting.

Sign in redirects seem to be functioning fine.

Sign out redirects work fine on me with Chrome but Firefox fails to dismiss.

We just released a new major version of Amplify (v2.0.0) and I do not observe this issue. This does appear to be a v1 library bug we will continue to look into, but if you are able to upgrade to v2, this may resolve the issue you are seeing.

@lokalathlet
Copy link
Author

lokalathlet commented Nov 22, 2022

@lokalathlet I've been able to finally replicate what you are reporting.

Sign in redirects seem to be functioning fine.

Sign out redirects work fine on me with Chrome but Firefox fails to dismiss.

We just released a new major version of Amplify (v2.0.0) and I do not observe this issue. This does appear to be a v1 library bug we will continue to look into, but if you are able to upgrade to v2, this may resolve the issue you are seeing.

Hi @tylerjroach , I have migrated to v2. I'm wondering that the docs doesn't mention the Response Handler handling anymore (https://docs.amplify.aws/lib-v1/auth/signin_web_ui/q/platform/android/#add-response-handler v1.n). But the callback still takes place. (WEB_UI_SIGN_IN_ACTIVITY_CODE isn't available anymore). How the user should handle a cancellation without using this feature. Or did I miss something?

Another severe issue with 2.0.0 is that Auth.fetchAuthSession().isSignedIn returns false always. That blocks me to switch to 2.0.0. Here are my dependencies.

object AWSCognito {
        private const val amplify_version = "2.0.0"
        private const val amplify_kotlin_version = "2.0.0"
        private const val escape_hatch_version = "0.17.12-beta"
        const val core = "com.amplifyframework:core:$amplify_version"
        const val auth = "com.amplifyframework:aws-auth-cognito:$amplify_version"
        const val coreKotlin = "com.amplifyframework:core-kotlin:$amplify_kotlin_version"
        const val cognitoidentityprovider = "aws.sdk.kotlin:cognitoidentityprovider:$escape_hatch_version"
        const val cognitoidentity = "aws.sdk.kotlin:cognitoidentity:$escape_hatch_version"
    }

There are never releases available for amplify_kotlin_version. e.g. 0.21.8. 2.0.0 is the right one? https://search.maven.org/artifact/com.amplifyframework/core-kotlin

@gpanshu
Copy link
Contributor

gpanshu commented Dec 29, 2022

Hello @lokalathlet when the user cancels the sign in or any other error happens the onError callback will be called with the relevant details. You do not need to implement any callbacks. Is that not the case?
If you are signed in the fetchAuthSession.isSignedIn should be true. If that is not the case please let us know and we can investigate further.

For your last question the latest release for Kotlin facade can be found here
All releases that we do can be found on our releases page : https://github.com/aws-amplify/amplify-android/releases

@gpanshu gpanshu added the closing soon This issue will be closed in 7 days unless further comments are made. label Dec 29, 2022
@gpanshu gpanshu self-assigned this Dec 29, 2022
@eeatonaws
Copy link
Contributor

Closing due to inactivity. Please reopen this issue or create a new issue if you have additional questions.

@github-actions
Copy link
Contributor

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

@sdhuka sdhuka reopened this Jan 19, 2023
@eeatonaws eeatonaws removed the closing soon This issue will be closed in 7 days unless further comments are made. label Jan 23, 2023
@lokalathlet
Copy link
Author

gpanshu I will update to the latest release soon, and come back to you with possible issues.

@tylerjroach
Copy link
Member

@lokalathlet I have a PR up for review to fix this issue. I'll let you know when its approved and live for v1.

@lokalathlet
Copy link
Author

@lokalathlet I have a PR up for review to fix this issue. I'll let you know when its approved and live for v1.

❤️

@tylerjroach
Copy link
Member

v1.38.0 fixed the issue. Please let me know if you see anything unexpected.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 9, 2023

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auth Related to the Auth category/plugins bug Something isn't working
Projects
None yet
Development

No branches or pull requests

9 participants