-
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 Amplify Signout issue #2218
Comments
FYI: I already gone through this thread: #1990 |
@ten-skv Unfortunately, v1 does not handle mixed sign in (webui + srp) as well as v2 does. The v1 implementation will trigger the CustomTab launch if there is an "Oauth" block in your configuration file, indicating that web sign in is configured. The expectation is that if a user did not sign in via web, the redirect should be triggered immediately back to the application and the rest of the sign in proceeds. Are you able to easily reproduce this, and are you observing on all browsers? FYI, v1 also has some differences in behavior on calling signIn while already signedIn. In this case, the signOut is failing and throwing the error. This means that the current user remained logged in. The reason it appears that it is accepting any password is because it is returning the current signed in user, it's not actually accepting any typed password. One last confirmation. I assume the signout redirect uri is valid and known to be configured correctly because you have some user using social web sign in? If the signout uri was not configured in Cognito, it could be the result of failed redirects, but it seems unlikely if you already have a fully functioning social web implementation. |
We are using both "Amplify.Auth.signInWithSocialWebUI" (some users using sso) and "Amplify.Auth.signIn" (some users using our user/password). This is easily reproducible. Please use the v1.37.9 and use the same configuration as mine. In this scenario, I'm signing in using "Amplify.Auth.signIn" (username and password). And when I call "Amplify.Auth.signOut" it takes to an external browser and redirects back to the app. I assume it is chrome browser. At this time it throws the time out exception. Some times it's successfully signout and able to relogin (it validates the username/password) Amplify.Auth.signOut( |
iOS Amplify library works fine and so does the earlier version of Android Amplify 1.4.1 (It has empty session issue, that's why I have moved to 1.37.9). I see this logout issue on 1.37.9. (Haven't checked other versions). Question 1: Is there any latest version I can use to fix this issue? |
@ten-skv When I updated the AndroidManifest.xml by adding additional intent-filters, the logout started working fine
|
@nazarcybulskij Is it on 1.37.9 version? I tried and it's not working for me. Here is my manifest snippet.
|
@ten-skv add intent-filters in MainActivity, not HostedUIRedirectActivity |
@nazarcybulskij I just tried with the added intent and still I'm able to login with the same user with invalid password (The session is still active). |
The correct implementation is to add the intent filters to the HostedUIRedirectActivity. However, please make sure your scheme's and host's are correct in the manifest and exactly match what you have configured. Instead of "myapp", please make sure your host matches whatever you have masked as "xxxxx" in your configuration.
Unless you are trying to add custom behavior to the sign in and sign out flows, you don't necessarily have to provide both a sign in and sign out intent, instead using one that captures both (removing the "hosts"). See here: https://docs.amplify.aws/lib-v1/auth/social/q/platform/android/#update-androidmanifestxml
|
@tylerjroach I'm using the exact scheme which I have configured (I never changed it from previous implementation). Signout not working after I upgrade to v1.37.9. Previously I was using v1.4.1 which was working fine (I have used a different activity configured in Androidmanifest.xml - "com.amazonaws.mobileconnectors.cognitoauth.activities.CustomTabsRedirectActivity") It is pretty easy to reproduce and it's happening every time. Again I'm using mix of both logins "Amplify.Auth.signInWithSocialWebUI" and "Amplify.Auth.signIn". |
@ten-skv Have you removed |
@tylerjroach Yes I have removed the CustomTabsRedirectActivity. Here is my current manifest.
|
Do you still have |
One additional question @ten-skv, if you sign in with |
For "signInWithSocialWebUI" flow "signout" works fine. I have this code on ActivityResults. It executes only for "signInWithSocialWebUI" (signin). `override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
|
@ten-skv Can you try removing that line? HostedUIRedirectActivity handles the web sign in/out on its own, and does not require that block. It's possible that this is interfering. If this still doesn't resolve the issue, I'd love to chat more on https://discord.gg/amplify and possibly set up a call. |
@tylerjroach HostedUIRedirectActivity handles code is executed only when social signin flow happens. But I removed it and tried and still same issue. |
Hi @ten-skv, unfortunately on v1, the Auth library does not track whether a sign in is from SRP or a social web sign in. This is the reason that the custom tab opens on signout, regrardless of the sign in method used. It is still critical that this HostedUIRedirectActivity receives the redirect on the signout of an SRP sigin. I would love to work with you 1-1 to further investigate this issue if you are willing. Please reach out on Discord and we can set up a call. |
@tylerjroach Thank you for helping me out. Sure will reach out in Discord. |
I have a PR fix for a different sign out issue (Hosted UI Custom Tab getting stuck on signout, especially Firefox). Would be curious if this has any impact to the issue you are running into. aws-amplify/aws-sdk-android#3184 |
Hi @ten-skv Checking to see if you have been able to diagnose this issue any further after our sync. |
I'm going to go ahead and close this issue, but please reach out if you continue to see the sign out issue described. |
|
Hey @tylerjroach, I'm also having same issue and stuck on it. Can you type your discord info please? I need to contact with you. |
Hi @aligkts, Can you please open a new issue with your implementation details and exactly what issues you are seeing. You can also reach out on our Discord server through https://discord.gg/amplify |
Before opening, please confirm:
Language and Async Model
Kotlin
Amplify Categories
Authentication
Gradle script dependencies
Environment information
Please include any relevant guides or documentation you're referencing
No response
Describe the bug
We are using both "Amplify.Auth.signInWithSocialWebUI" (some users using sso) and "Amplify.Auth.signIn" (some users using our user/password).
Issue: Even-though initially user logged in using "Amplify.Auth.signIn" , when signing out, user is taken to the browser to and it throws error.
AuthException{message=Failed to sign out, cause=com.amazonaws.mobileconnectors.cognitoauth.exceptions.AuthServiceException: Timed out while waiting for sign-out redirect response., recoverySuggestion=See attached exception for more details}
at com.amplifyframework.auth.cognito.AWSCognitoAuthPlugin$22.onError(AWSCognitoAuthPlugin.java:1198)
.....
At this scenario, when user trying to re-login ("Amplify.Auth.signIn") with user_name/password, it accepts any password and user was able to successfully login.
Reproduction steps (if applicable)
To Reproduce
Code Snippet
// Put your code below this line.
Log output
amplifyconfiguration.json
Amplify configuration:
GraphQL Schema
Additional information and screenshots
No response
The text was updated successfully, but these errors were encountered: