Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Apple Sign in flutter AuthorizationAppleID(null, null, null, null, null)

I am trying to implement apple sign with flutter. I am getting all the values as null. First Time I got name and email id but got auth_id and id_token as null. Second time all the values came null like. AuthorizationAppleID(null, null, null, null, null)

_applelogin() async {
    provider = 'apple';
        final credential = await SignInWithApple.getAppleIDCredential(
          scopes: [
            AppleIDAuthorizationScopes.email,
            AppleIDAuthorizationScopes.fullName
          ],
          webAuthenticationOptions: WebAuthenticationOptions(
            clientId: 'com.example.com',
            redirectUri: Uri.parse('https://My-Project.glitch.me/callbacks/sign_in_with_apple'),
          ),
        );
        print(credential);
  }
like image 261
Aman Mishra Avatar asked Sep 05 '26 13:09

Aman Mishra


1 Answers

I solved this problem.

  1. Check your server credential(.p8, PRIVATE KEY) file which is private key.

  2. you can check 'authorizationCode','identityToken' than use like this code.

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

      // Sign in the user with Firebase. If the nonce we generated earlier does
      // not match the nonce in `appleCredential.identityToken`, sign in will fail.
      final user = await FirebaseAuth.instance.signInWithCredential(oauthCredential);
like image 168
JD Kim Avatar answered Sep 07 '26 07:09

JD Kim



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!