aws-sdk-ios icon indicating copy to clipboard operation
aws-sdk-ios copied to clipboard

AWSMobileClient, Sign In With Apple sheet shows above a web view.

Open hossamghareeb opened this issue 4 years ago • 5 comments

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 Screen Shot 2020-03-10 at 12 21 57 PM

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

hossamghareeb avatar Mar 10 '20 11:03 hossamghareeb

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

lawmicha avatar Mar 11 '20 00:03 lawmicha

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.

hossamghareeb avatar Mar 11 '20 08:03 hossamghareeb

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!

lawmicha avatar Mar 20 '20 19:03 lawmicha

Hello everyone, Any update about this issue? We are on the same boat. Thanks!

albidev avatar Dec 09 '20 08:12 albidev

Hello @lawmicha It's been over two years. Has this been fixed? 😄

pedromancheno avatar Jul 07 '22 15:07 pedromancheno

Any updates on this one?

RadekNov avatar Apr 15 '23 23:04 RadekNov

We recommend using Amplify Authenticator for this -- for more information, please visit the Authenticator docs. Thanks!

atierian avatar Dec 06 '23 21:12 atierian