When I trigger the Apple Sign in with the below codes:
Future<UserCredential> signInWithApple() async {
final appleProvider = AppleAuthProvider();
appleProvider.addScope('email');
// appleProvider.setCustomParameters({
// 'client_id': 'com......firebase', // service ID
// }); // client_id is reserved
return await FirebaseAuth.instance.signInWithProvider(appleProvider);
}
It launches the chrome with proper information from the service I created at Apple developer, it seems that the sign in process finishes properly. But when it gets back to the Android App, I get the following error message:
FirebaseAuthException: Code: invalid-credential, Message: HttpMetadata{status=400, cachePolicy=NO_CACHE, cacheDurationJava=null, cacheImmutable=false, staleWhileRevalidate=null, filename=null, lastModified=null, retryAfter=null, crossOriginEmbedderPolicy=null, crossOriginOpenerPolicy=null, crossOriginResourcePolicy=null, permissionsPolicies=[], headers=HTTP/1.1 200 OK, contentSecurityPolicies=[], originTrials=[], reportToHeaders=[], varyHeaderNames=[], cookieList=[]}}, StackTrace: null
I have created the keys and services twice and double checked everything with Apple developer, put in the call back as suggested by Firebase with domain.
Put the values in Firebase Auth as it is required, but it seems not to be working and the error persists.
If I cancel the error code is "web-context-canceled" so I think it is okay.
If anybody faced similar issues any suggestion will be greatly appreciated.
There was a space before the teamID in my firebase auth setup! Please check for white spaces for teamID, Service ID etc.