Flutter Web Sign in with Apple returning unknown exception

I am trying to implement Sign in with Apple for my Flutter web-only project.

I have thoroughly followed the instructions for the web implementation in the FlutterFire documentation (https://firebase.flutter.dev/docs/auth/social#apple). I have not implemented it for iOS nor Android. I have already successfully implemented Google and Facebook login in my web app.

When I call:

import 'package:firebase_auth/firebase_auth.dart';

Future<UserCredential> signInWithApple() async {
  // Create and configure an OAuthProvider for Sign In with Apple.
  final provider = OAuthProvider("apple.com")
    ..addScope('email')
    ..addScope('name');

  // Sign in the user with Firebase.
  return await FirebaseAuth.instance.signInWithPopup(provider);
}

I get the following error (and no sign-in with apple pop-up appear on my Chrome test window):

FirebaseAuthException ([firebase_auth/unknown] An unknown error occurred: Unexpected null value.)
>
credential:null
email:null
phoneNumber:null
tenantId:null

What could be the problem ? What could be the unexpected null value ? If it is the email value, why don't I have at least the sign-in with apple popup ?


Solution 1:

Have you made all the configurations? In my case, it was missing the OAuth code flow configuration data. Adding it solved.