aws-sdk-ios
aws-sdk-ios copied to clipboard
AWSMobileClient, Sign In With Apple sheet shows above a web view.
Describe the bug
When I use the hosted UI to sign in with apple via:
let hostedUIOptions = HostedUIOptions(scopes: ["openid", "email", "profile"], identityProvider: "SignInWithApple")
I could log in successfully but the native sheet opens above the web view which looks off. The native implementation will show the native sheet directly but if we use Cognito, there is a layer in between.
Which AWS service(s) are affected?
Expected behavior To let Cognito SDK shows the native sign in with apple sheet directly if possible.
Screenshots
Environment(please complete the following information):
- SDK Version: 2.12.6
- Dependency Manager: Cocoapods
Device Information (please complete the following information):
- Device: iPhone XS
- iOS Version: iOS 13.3
Hi @hossamghareeb, thanks for bring this up, I tested this on my device and I believe this isn't something the SDK can easily fix as we leverage Cognito's HostedUI feature for the sign-in flow. HostedUI endpoints provides a way to authenticate with the social providers and create a user in Cognito UserPool on first Sign-In. In other cases, directly launching the hostedUI for Google/Facebook will finish loading that webview with Facebook/Google's sign in page. In Apple's case, they are unique such that it launches the second native modal that you see there. Consider the end user chooses "Use Different Apple ID", it will close the second modal and finish loading the webview behind it onto Apple's sign in page. We don't have control over that trigger to easily adjust the height of the webview to hide it at the beginning. However this is a good call out regarding using hostedUI experience with Apple.
The other option I see here is to federate directly with Apple, and pass the token to federatedSignIn
which will authenticate your end user with Cognito Identity Pools, but this will not create a user in the User Pool.
Please let us know if you have any more questions
Thanks, @lawmicha for your reply. Unfortunately, the federated option is not applicable for us as we need a JWT token which requires creating a user in User Pool. I'm just worried about Apple review and app gets rejected for this weird behavior.
we'll be taking this as a feature request to provide a way to optionally pass a presentation style so that developers an better control the UX for their users!
Hello everyone, Any update about this issue? We are on the same boat. Thanks!
Hello @lawmicha It's been over two years. Has this been fixed? 😄
Any updates on this one?
We recommend using Amplify Authenticator for this -- for more information, please visit the Authenticator docs. Thanks!