capacitor-community / apple-sign-in

Sign in with Apple Support
MIT License
143 stars 60 forks source link

"Sign Up Not Completed" Error #23

Open bfan1256 opened 3 years ago

bfan1256 commented 3 years ago

Describe the bug When trying to sign in, the modal pops up but produces a "Sign Up Not Completed" Error

To Reproduce Steps to reproduce the behavior:

  1. Follow installation steps.
  2. Utilize a similar function like below:
/**
 * Creates a user account with Apple
 */
async createAccountWithApple() {
  this.analytics.logEvent('sign_up_apple');
  const options: SignInWithAppleOptions = {
    clientId: '<client-id>',
    redirectURI: '<redirect-uri>',
    scopes: 'email',
    state: '1256',
    nonce: 'nonce'
  };
  return SignInWithApple.authorize(options)
    .then(async (res: SignInWithAppleResponse) => {
      if (res.response && res.response.identityToken) {
        const credential = new firebase.auth.OAuthProvider('apple.com')
          .credential({
            idToken: res.response.identityToken
          });
        return this.auth.signInWithCredential(credential);
      }
    });
}

Expected behavior The user should be able to sign in. I have tried also with different redirectURIs and none seem to work I'm not sure how to utilize a redirectURI for an iOS app. There doesn't seem to be a need as I'm not trying to implement a web platform for this. Is there a way to remove it?

Smartphone (please complete the following information):

zakrava commented 3 years ago

I have exactly the same issue here. It will not come to then or catch, there is not even a thing in iOS native debug log.

Device: iPhone 7 Plus OS: iOS 14.4 Ionic Capacitor

aditbharadwaj commented 3 years ago

Do you guys have an update for this ? i dont want to include a redirect URI as once i have the info i can log in.

edy-ap commented 3 years ago

I have the same issue, any update?

mattbatman commented 3 years ago

This is not documented, but I believe that passing options: SignInWithAppleOptions to authorize (e.g. SignInWithApple.authorize(options)) triggers a web client and traditional web OAuth 2.0 flow that requires a redirect URI, but passing no options or leaving it undefined (e.g. SignInWithApple.authorize()) uses the native iOS client.

I can get SignInWithApple.authorize() to open Apple ID authorization on an iPhone without a redirect URI attempt. Personally, I haven't gotten SignInWithApple.authorize() to ever provide me an email address, family name, or given name for the user. I'm not sure whether that's a problem with the library or something I've done.

mattbatman commented 3 years ago

My comment above is wrong. I think you can just leave the redirect URI blank if you aren't going to use it.

apclegacy commented 3 years ago

Workaround: i had the same problem in the ios 14. simulator. There seem to be problems with this versions. It's working fine in the ios 13.7 simulator.

arielhasidim commented 2 years ago

If your problems is when you try to pass the credentials to firebase.auth, check my answer here: https://github.com/capacitor-community/apple-sign-in/issues/65

alexortizi commented 1 year ago

Any updates? Same issue here

ghost commented 1 year ago

You guys can go to the apple development page

image image

make sure "Sign In with Apple" checkbox is ticked