'com.apple.AuthenticationServices.Authorization Error Code 1000

I receive the following error in DidCompleteWitherror:

com.apple.AuthenticationServices.Authorization Error Code 1000

I'm using the following code to sign in to Apple

var appleIdProvider = new ASAuthorizationAppleIdProvider();
var request = appleIdProvider.CreateRequest();
request.RequestedScopes = new ASAuthorizationScope[] { ASAuthorizationScope.Email, ASAuthorizationScope.FullName };
var authController = new ASAuthorizationController(new[] { request });
authController.Delegate = this;
authController.PresentationContextProvider = this;
authController.PerformRequests();
...
[Export("authorizationController:didCompleteWithAuthorization:")]
public void DidComplete(ASAuthorizationController controller, ASAuthorization authorization)
{
...
}

[Export("authorizationController:didCompleteWithError:")]
public void DidComplete(ASAuthorizationController controller, NSError error)
{
...
}
  • I checked Apple Sign-in in the Entitlements.plist
  • I created app id in the management console, verified my domain. Even web auth works already.
  • I tried to switch provisioning profile to one with apple sign in.

What could be the reason of this error?



Solution 1:[1]

Turns out to be problems with missing settings in csproj.

Found the Answer here: https://xamarin.github.io/bugzilla-archives/25/25141/bug.html

I opened csproj and discovered some build configuration were missing CodesignEntitlements and some of them were empty:

<CodesignEntitlements>Entitlements.plist</CodesignEntitlements>

After adding it to/updating it in all build configurations it finally works.

PS: Before that I tried to create empty xamarin project (with the same bundle name) and it reproduced the problem on simulator. Then I did swift project (with the same bundle name) and it worked fine. So it was clear that it was xamarin specific bug.

Solution 2:[2]

After searching I found that it works on a real device and SOMETIMES doesn’t work on the simulator.

But I solved it by logging in here and removing the simulator under Devices. Then building it again. Don't forget to add “Sign in with Apple” in “Signing & Capabilities”.

Solution 3:[3]

I got this error because forget to add sign in capability.

capability

Solution 4:[4]

Fist of all, all above answer are correct to me.

Second, I spend some hours to found out that I miss add Sign with Apple ID Entitlements in release config, So I just past what I do here.

You can check by any one of bellow:

1. Check every tab under Signing & capabilities in Xcode

enter image description here

2. Search com.apple.developer.applesignin in vscode(or other file tool), you should find 3 Entitlements files

enter image description here

3. Check files in project folder in vscode(or other file tool), you should find 3 Entitlements files with com.apple.developer.applesignin included.

enter image description here

Solution 5:[5]

A verification step from Apple is not required, despite the misleading documentation on their side.

Could you try to run a new build and make sure to create a new provisioning profile with updated capabilities inside?

Make sure the "Apple Sign-in" entitlement is added to your build settings, and in your Apple certs from the developer portal.

If you're running a development build, try switching to a production build. You might need to go as far as signing the app bundle for Ad Hoc distribution and installing it that way.

As you can check in the Apple Documentation, the 1000 error code really means that the error is unknown, so this solution may not work for you. In terms of your code, it seems alright to me! You can also check these samples!

Solution 6:[6]

Remove App from Apps using apple id in password & security setting

To remove app, Go to settings > Profile > Password & Security > Apps using apple id > Your App > Stop using apple id

Solution 7:[7]

I'm using Swift, and I'm gonna say about it, Sometimes the Apple Id login on iPhone needs to be required Two-Factor Authorization, so my code is

        if #available(iOS 13.0, *) {
            let appleIDProvider = ASAuthorizationAppleIDProvider().createRequest()
            appleIDProvider.requestedScopes = [.fullName, .email]
            
            //let passwordProvider = ASAuthorizationPasswordProvider().createRequest()
            
            let authorizationController = ASAuthorizationController(authorizationRequests: [appleIDProvider])
            authorizationController.delegate = self
            authorizationController.presentationContextProvider = self
            authorizationController.performRequests()
        } else {
            // Fallback on earlier versions
        }

The password request ASAuthorizationPasswordProvider is annotated and skipped that line due to the reason to Apple Id on phone.

When an Apple ID needs to be required Two-Factor Authorization, then we can request this provider ASAuthorizationPasswordProvider, we have to delete the code. After you remove the line code, all run work.

Solution 8:[8]

I had the same problem.

My code:

if #available(iOS 13.0, *) {
    let appleIDProviderRequest = ASAuthorizationAppleIDProvider().createRequest()
    appleIDProviderRequest.requestedScopes = [.fullName, .email]
    let passwordProviderRequest = ASAuthorizationPasswordProvider().createRequest()
    let requests = [appleIDProviderRequest, passwordProviderRequest]

    // Create an authorization controller with the given requests.
    let authorizationController = ASAuthorizationController(authorizationRequests: requests)
    authorizationController.delegate = self
    authorizationController.presentationContextProvider = self
    authorizationController.performRequests()
}

I tested this code using 2 Apple accounts. One account works, another - no. Then I removed ASAuthorizationPasswordProvider().createRequest() and the problem dissapeared. I think Apple will solve this issue in future.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2 bdesham
Solution 3 Vladislav Zaynchkovsky
Solution 4
Solution 5 Jeremy Wiebe
Solution 6 Aravind Vemula
Solution 7 Johnny
Solution 8