50

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?

Saamer
  • 4,687
  • 1
  • 13
  • 55
Access Denied
  • 8,723
  • 4
  • 42
  • 72

10 Answers10

78

I got this error because forget to add sign in capability and restart the app.

capability

SwiftiSwift
  • 7,528
  • 9
  • 56
  • 96
Vladislav Zaynchkovsky
  • 2,461
  • 2
  • 14
  • 22
49

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”.

bdesham
  • 15,430
  • 13
  • 79
  • 123
Heartless Vayne
  • 904
  • 1
  • 8
  • 18
  • 1
    I found it working fine on simulator for awhile, then it started failing with the error code in this post. Noe's suggestion worked for me. It may be due to signing in from multiple different simulator devices, not sure, but removing it from my dev account as above was all I needed. Didn't even have to rebuild or relaunch. Just retried and success. – Paul Bruneau Aug 18 '20 at 15:35
  • 1
    @PaulBruneau same situation :) – Heartless Vayne Aug 19 '20 at 04:35
  • Yup, it was the "Sign In with Apple" not added to "Signing & Capabilities" – Eric May 14 '22 at 04:32
30

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

JerryZhou
  • 4,566
  • 3
  • 37
  • 60
16

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.

Access Denied
  • 8,723
  • 4
  • 42
  • 72
3

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!

Jeremy Wiebe
  • 3,894
  • 22
  • 31
Saamer
  • 4,687
  • 1
  • 13
  • 55
  • I've seen this info already in the following link, thank you for coping it here: https://github.com/expo/expo/issues/5781 – Access Denied Dec 14 '19 at 08:42
1

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.

Johnny
  • 1,112
  • 1
  • 13
  • 21
  • It sounds like you discovered an issue that users may face too unless you're somehow confident this is only a sim issue? – aehlke Apr 25 '21 at 16:02
1

I solved this error by Adding Sign In with Apple into Sign & Capabilities tap

Ahmed Rajib
  • 67
  • 1
  • 4
0

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.

Vasily Bodnarchuk
  • 24,482
  • 9
  • 132
  • 127
0

I'm able to reproduce this when I sign out from Apple ID in the OS Settings.

If I click on "Close" when prompted "Sign in with Apple ID. You need to sign in with your Apple ID in Settings", then I get this 1000 error code. prompt

Simon Reggiani
  • 550
  • 10
  • 18
0

I had to set a development team before it would let me go through with it.

user3413723
  • 11,147
  • 6
  • 55
  • 64