-
Notifications
You must be signed in to change notification settings - Fork 119
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
Comments
Hi @lokalathlet - sorry you are facing this issue. Would you be able to share any logs around the time this occurs? |
@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 |
Manifest:
Configuration Json:
} |
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 |
@lokalathlet SignOutRedirectURI of "elbaapp://signout" doesn't match "sibaapp://signout" defined in the manifest. |
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... |
Hi @tylerjroach, you're right, but i just missed to rename it in the snipped. |
Moving this to the Android repository. FYI @lokalathlet @tylerjroach |
another log 2022-09-22 08:36:40.678 6244-6244/de.db.xxxx.test I/Dialog: mIsDeviceDefault = false, mIsSamsungBasicInteraction = false, isMetaDataInActivity = false |
@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 %). |
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. |
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? |
I have a question regarding this. I wonder why app needs to display full screen CustomTab at first place? |
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. |
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. |
@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
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. |
Hi @tylerjroach, my AndroidManifest.xml currently doesn't contain any custom sign in or out Activity configurations. Nevertheless I can see the issue.
|
@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).? |
@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. |
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? |
@tylerjroach My assumption was, that the default is set to the Chrome package if not set.
I observing the issue during testing. |
@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.
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 |
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? For your last question the latest release for Kotlin facade can be found here |
Closing due to inactivity. Please reopen this issue or create a new issue if you have additional questions. |
|
gpanshu I will update to the latest release soon, and come back to you with possible issues. |
@lokalathlet I have a PR up for review to fix this issue. I'll let you know when its approved and live for v1. |
❤️ |
v1.38.0 fixed the issue. Please let me know if you see anything unexpected. |
|
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
Steps to Reproduce
Screenshots
Platforms
Android Device/Emulator API Level
API 32+
Environment
Dependencies
Device
n/a
OS
n/a
Deployment Method
Custom Pipeline
CLI Version
n/a
Additional Context
No response
Amplify Config
n/a
The text was updated successfully, but these errors were encountered: