aboutyou / dart_packages

Dart and Flutter plugins maintained and used by @ABOUTYOU
220 stars 149 forks source link

[SIGN_IN_WITH_APPLE]"Cannot Complete Request" Error after Clicking "Continue", Flutter Web #395

Open 1ns4n33 opened 7 months ago

1ns4n33 commented 7 months ago

Hello,

I'm encountering an issue with implementing Apple Sign-In in my Flutter application using Firebase. I've followed all the required steps for setting up Apple Sign-In, including configuring the key and certificates through the Apple Developer account and setting up the OAuth code flow in Firebase.

Everything works up to the point where the Apple Sign-In popup asks the user if they want to continue using the app with their Apple ID. After clicking "Continue", instead of completing the sign-in process, I receive an error message stating, "Cannot complete the request due to an error. Please try again later."

Here are the steps I've taken:

Despite these configurations, I'm stuck at the error mentioned above. It's important to note that I'm not using a custom backend; I'm relying entirely on Firebase and Flutter for the authentication process.

I suspect this might be related to some configuration issue or a specific behavior in how Firebase or the browser handles the OAuth flow, but I'm unsure how to proceed in debugging this problem.

Could anyone provide insights or suggestions on how to resolve this issue? Any help would be greatly appreciated.

Additionally, if you wish to experience the issue firsthand, you can attempt the Apple Sign-In process on our application's website (With Google) at app.jimtime.it. This might provide a clearer understanding of the problem's nature and the point at which the error occurs.

Thank you

HenriBeck commented 5 months ago

Hey,

Could you please share some code on how you use our sign_in_with_apple package??

Cannot complete the request due to an error. Please try again later.

Is this error still on the Apple website or is that on your own webpage?

dleurs commented 3 weeks ago

Same issue here

Apple sign in working on Android and iOS, but not on web :

`

if (kIsWeb) {
  final rawNonce = generateNonce();
  final nonce = sha256ofString(rawNonce);

  final appleCredential = await SignInWithApple.getAppleIDCredential(
    scopes: [
      AppleIDAuthorizationScopes.email,
    ],
    webAuthenticationOptions: WebAuthenticationOptions(
            clientId: "fr.trompe.appli.login",
            redirectUri: Uri.parse("https://loftXXXrtle.glitch.me/callbacks/sign_in_with_apple"),
          ),
    nonce: nonce,
  );

  final oauthCredential = OAuthProvider("apple.com").credential(
    idToken: appleCredential.identityToken,
    rawNonce: rawNonce,
  );

  return await FirebaseAuth.instance.signInWithCredential(oauthCredential);
}

`

360063393-417dd4ad-090f-4602-9a28-42d4c40ca09c

AlmutawakelSukaina commented 3 days ago

I’m experiencing the same problem and would appreciate any updates or potential workarounds. @1ns4n33