Sign in with apple id stuck on cancel

Hi there,


I am a developer for sign in with apple id. I recently got a customer complain about not being able to proceed by clicking the "sign in with apple id" button again after this customer chose not to sign in with apple by clicking the "cancel" button from the apple pop out the modal dialog.


Repro steps are as following:

1. Click "sign in with apple id"

2. User observes the apple pop up modal dialog for selecting the account.

3. User click "Cancel"

4. User try to click "sign in with apple id" again and nothing happens.


I also observed that the progress bar on the address bar stuck in the middle once I clicked the "cancel" button. I observed no error from the console. And this seems like a Safari only issue, it happens on both mobile and laptop Safari.


Does anybody know what is wrong and how to fix this problem?

Replies

Also having this issue.


Our sign in flow works flawlessly on every browser except Safari on iOS13 and latest Safari on Catalina. It breaks when the native Safari auth popup is involved.


We follow the flow described in: https://developer.apple.com/documentation/signinwithapplejs/incorporating_sign_in_with_apple_into_other_platforms


The most interesting part is once you click on the sign in button no network requests are shown in Safari dev console, but I can see the URL changing briefly.

Have you tried using Firefox? I noticed that the console on Firefox may give more useful error messages to help you determine why nothing happens on your step 4.

Hi, i have similar issue with you. After few days of struggling, I finally manage to solve my issue. My issue is the redirectUri that I pass at webAuthenticationOptions is wrong, it should be the domain of my web app (https://myapp.domain.com/) instead of Firebase or third party url.

final appleCredential = await SignInWithApple.getAppleIDCredential(
        scopes: [
          AppleIDAuthorizationScopes.email,
          AppleIDAuthorizationScopes.fullName,
        ],
        state: 'origin:web',
        webAuthenticationOptions: WebAuthenticationOptions(
            clientId: appleServiceId, // 'com.mycompany.app.service'
            redirectUri: Uri.parse(appleRedirectUri,) // 'https://webapp.mydomain.com/'
        ),
      );
      final oauthCredential = OAuthProvider("apple.com").credential(
        idToken: appleCredential.identityToken,
        accessToken: appleCredential.authorizationCode,
      );
      if (oauthCredential == null) return;

      Module().showLoadingDialog(Get.context!);

      await FirebaseAuth.instance.signInWithCredential(oauthCredential);

Besides that, the domains and subdomains & Return URLs also need to add your web app domain at apple developers console under Certificates, Identifiers & Profiles -> Identifiers -> Services IDs.