amplify-android: Social sign in adds user to federated pool but doesn't redirect
Describe the bug I’m integrating social signIn using Facebook and google into my android app. I’m using this guide . when the user clicks on the social sign in button, he gets added to the social pool however the app does not redirect. For Google, it stays loading the redirection url with a blank webview. this is the redirect URL https://projectxyz13568-ffff-local.auth.us-east-1.amazoncognito.com/oauth2/authorize?client_id=4hmdq6hcn2cjj6cl9q57vnhhvi&redirect_uri=redirectURI%3A%2F%2F&response_type=code&code_challenge=sreyQtr86U6HWSgzQ04wnSpi2rKyyAX5azG21KoNUxc&code_challenge_method=S256&state=CRVUtDPhnXMQz967j_CZe60cNJvvk0ga7IIbSyDvN2o&userContextData=null&identity_provider=Google
in the first tries, it allows to choose the account if there’s multiple accounts on the device but after that it just keeps loading nothing. just a blank webview. When I close the webview I get the ’ authentication flow canceled by user’.
To Reproduce A code sample or steps:
Amplify.Auth.signInWithSocialWebUI(AuthProvider.google(), this.requireActivity(), {
Log.i("successGG", it.isSignInComplete.toString())
}, {
Log.i("errorGG", it.localizedMessage)
})
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
super.onActivityResult(requestCode, resultCode, data)
Log.d("requestCode","${requestCode} resultCode=${resultCode} data=$data")
if (requestCode == AWSCognitoAuthPlugin.WEB_UI_SIGN_IN_ACTIVITY_CODE) {
if (data != null) {
if (resultCode == Activity.RESULT_CANCELED) {
Amplify.Auth.handleWebUISignInResponse(data)
}
}
}
}
Which AWS service(s) are affected?
Expected behavior User chooses account, signs in and gets redirected to my application, homefragment
Screenshots

Environment Information (please complete the following information):
- AWS Android SDK Version: [e.g. 2.6.25]
- Device: [e.g. Pixel XL, Simulator]
- Android Version: [e.g. Nougat 7.1.2]
- Specific to simulators: [e.g. Yes/No]
Additional context Add any other context about the problem here.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 2
- Comments: 39 (12 by maintainers)
Thanks with your suggestion I solved the question too. I remain of the idea that the documentation should be clearer on this point
Hey thanks, @tjleing my issues have been resolved the day I did my last comment. The issue was only related to I missed to add uri scheme in my AndroidManifest.xml file.
Still facing the same issue 😦
To clarify, the important parts of the manifest file are:
<queries>block (outside of the<application>block)<activity android:name="com.amplifyframework.auth.cognito.activities.HostedUIRedirectActivity" ...> ...block (inside the<application>block) to handle both the login and the logout callbackswhere the name of the Activity (
android:name="...") and the URI (android:scheme="myapp" android:host="signout", corresponding tomyapp://signout) match the Activity you want to redirect to and the URI you specified when configuring Auth.Please make sure your manifest has: