Android sign in to APPLE with Firebase

335 Views Asked by At

I am implementing apple sign in with Firebase in Android. I have followed the instructions mentioned here : https://help.apple.com/developer-account/#/dev1c0e25352 also created the Key, as mentioned here : https://help.apple.com/developer-account/#/dev77c875b7e also enabled Apple Sign in from firebase console and added the Service ID, and newly generated Key data to the firebase console.

my Code :

OAuthProvider.Builder provider = OAuthProvider.newBuilder("apple.com");
List<String> scopes =
    new ArrayList<String>() {
      {
        add("email");
        add("name");
      }
    };
provider.setScopes(scopes);

mAuth.startActivityForSignInWithProvider(this, provider.build())
        .addOnSuccessListener(
                new OnSuccessListener<AuthResult>() {
                    @Override
                    public void onSuccess(AuthResult authResult) {
                        // Sign-in successful!
                        Log.d(TAG, "activitySignIn:onSuccess:" + authResult.getUser());
                        FirebaseUser user = authResult.getUser();
                        // ...
                    }
                })
        .addOnFailureListener(
                new OnFailureListener() {
                    @Override
                    public void onFailure(@NonNull Exception e) {
                        Log.w(TAG, "activitySignIn:onFailure", e);
                    }
                });

but i am getting an error, in the OnFailureListener:

The supplied auth credential is malformed or has expired. [ Error getting access token from https://appleid.apple.com, OAuth2 redirect uri is: https://******.firebaseapp.com/__/auth/handler, response: OAuth2TokenResponse{params: error=invalid_client, httpMetadata: HttpMetadata{status=400, cachePolicy=NO_CACHE, cacheDurationJava=null, cacheImmutable=false, staleWhileRevalidate=null, filename=null, lastModified=null, retryAfter=null, headers=HTTP/1.1 200 OK

can anyone help out here.

0

There are 0 best solutions below