twogate / cordova-plugin-sign-in-with-apple

A native-implemented plugin of Sign in with Apple // Thanks to your contribution! // Cordova>=8 iOS>=13
https://www.npmjs.com/package/cordova-plugin-sign-in-with-apple
MIT License
74 stars 48 forks source link

Authorization failed #25

Open AbdullaevTimur opened 4 years ago

AbdullaevTimur commented 4 years ago

I have new issue i haven't before. When I try to "sign in with apple" i catch error [core] Authorization failed: Error Domain=AKAuthenticationError Code=-7034 "(null)" UserInfo={AKClientBundleID=xxxxx}. Before all worked great with the same settings (capability "sign in with apple" included). I test this issue on real and simulator devices. I can't find anything about "7034" error code.

AbdullaevTimur commented 4 years ago

This is my log that I intercepted:

`2020-08-13 11:45:09.647647+0500 0x1c4dc Default 0x1f8b4 5975 0 akd: [com.apple.authkit:core] Updating token for service with ID com.apple.gs.supportapp.auth... 2020-08-13 11:45:09.660404+0500 0x1c4dc Default 0x1f8b4 5975 0 akd: [com.apple.authkit:core] Updating token for service with ID com.apple.gs.authagent.auth... 2020-08-13 11:45:09.676626+0500 0x1c4dc Default 0x1f8b4 5975 0 akd: [com.apple.authkit:core] Updating token for service with ID com.apple.gs.idms.ln... 2020-08-13 11:45:09.779723+0500 0x1c4dc Default 0x1f8b4 5975 0 akd: [com.apple.authkit:core] Updating token for service with ID com.apple.gs.beta.auth... 2020-08-13 11:45:09.822323+0500 0x1c4dc Default 0x1f8b4 5975 0 akd: [com.apple.authkit:core] Updating token for service with ID com.apple.gs.icloud.family.auth... 2020-08-13 11:45:09.839498+0500 0x1c4dc Default 0x1f8b4 5975 0 akd: [com.apple.authkit:core] Updating token for service with ID com.apple.gs.pb.auth... 2020-08-13 11:45:09.852894+0500 0x1c4dc Default 0x1f8b4 5975 0 akd: [com.apple.authkit:core] Updating token for service with ID com.apple.gs.itunes.mu.invite... 2020-08-13 11:45:09.866471+0500 0x1c4dc Default 0x1f8b4 5975 0 akd: [com.apple.authkit:core] Updating token for service with ID com.apple.gs.icloud.auth... 2020-08-13 11:45:09.879355+0500 0x1c025 Default 0x1f8b4 5975 0 akd: [com.apple.authkit:core] Cleared to end auth with context <AKAppleIDAuthenticationContext: 0x7fcfab51fd80 { UUID: 7FB34DDF-8A3B-4CD1-8675-DC3F988758BA }>. 2020-08-13 11:45:09.880276+0500 0x1c524 Default 0x1f8b4 6077 0 AuthKitUIService: (AuthKit) [com.apple.authkit:core] Remote authentication service came back with: { AKAdditionalInfo = { obfuscatedPhoneNumbers = ( { maskedPhoneNumber = "* () -8-05"; recentlyUsed = 1; } ); phoneNumbers = ( { phoneNumber = " () -*8-05"; recentlyUsed = 1; type = 2fa; } ); }; AKAltDSID = "001649-08-b6xxx585-4f42-48c7-ab85-9cxxx258c863"; AKAuthenticationMode = 1; AKDSID = 16482777680; AKIDMSToken = { "(cag).appleid.auth" = "GXX3..."; "(cag).authagent.auth" = "AAAA..."; "(cag).beta.auth" = "AAAA..."; "(cag).dip.auth" = "AAAA..."; "(cag).global.auth" = "AAAA..."; "(cag).icloud.auth" = "XX3..."; "(cag).icloud.family.auth" = "AAAA..."; "(cag).icloud.storage.buy" = "AAAA..."; "(cag).idms.hb" = 0; "(cag).idms.ln" = "AAAA..."; "(cag).idms.pet" = "GXX3..."; 2020-08-13 11:45:09.880371+0500 0x1c524 Default 0x1f8b4 6077 0 AuthKitUIService: (AuthKitUI) [com.apple.authkit:core] Selected request contains email scope. 2020-08-13 11:45:09.882212+0500 0x1c4f6 Default 0x1f8b4 5975 0 akd: [com.apple.authkit:core] Remote view sent a user response event: <AKAuthorizationUserResponse: 0x7fcfab70c970 { selectedRequest: <AKAuthorizationRequest: 0x7fcfab713e80 { requestIdentifier: 1B18A7C2-26F2-48DF-B67B-1A25DC745788, clientID: (null), teamID: (null), userIdentifier: (null), altDSID: 001649-08-b6397585-4f42-48c7-ab85-9ce0b258c863, state: (null), nonce: (null), requestedScopes: ( name, email ), appProvidedData: (null), isSilentAppTransfer: 0, }>, authorizationSelection: YES, loginChoice: 9223372036854775807, rawPassword: (**)} 2020-08-13 11:45:09.880411+0500 0x1c524 Default 0x1f8b4 6077 0 AuthKitUIService: (AuthKitUI) [com.apple.authkit:core] Selected request contains name scope. 2020-08-13 11:45:09.876710+0500 0x1b58d Activity 0x20c56 5960 0 bird: (CloudDocsDaemon) apply-changes 2020-08-13 11:45:09.882397+0500 0x1c4f6 Default 0x1f8b4 5975 0 akd: [com.apple.authkit:core] Got a response from user: <AKAuthorizationUserResponse: 0x7fcfab70c970 { selectedRequest: <AKAuthorizationRequest: 0x7fcfab713e80 { requestIdentifier: 1B18A7C2-26F2-48DF-B67B-1A25DC745788, clientID: (null), teamID: (null), userIdentifier: (null), altDSID: 001649-08-b6397585-4f42-48c7-ab85-9ce0b258c863, state: (null), nonce: (null), requestedScopes: ( name, email ), appProvidedData: (null), isSilentAppTransfer: 0, }>, authorizationSelection: YES, loginChoice: 9223372036854775807, rawPassword: (**)} 2020-08-13 11:45:09.881041+0500 0x1c524 Default 0x1f8b4 6077 0 AuthKitUIService: [com.apple.authkit:core] UI service initiating authorization request with userSelection: <AKAuthorizationUserResponse: 0x6000009fccc0 { selectedRequest: <AKAuthorizationRequest: 0x600002cb4f50 { requestIdentifier: 1B18A7C2-26F2-48DF-B67B-1A25DC745788, clientID: (null), teamID: (null), userIdentifier: (null), altDSID: 001649-08-b6397585-4f42-48c7-ab85-9ce0b258c863, state: (null), nonce: (null), requestedScopes: ( name, email ), appProvidedData: (null), isSilentAppTransfer: 0, }>, authorizationSelection: YES, loginChoice: 9223372036854775807, rawPassword: (**)} 2020-08-13 11:45:09.882523+0500 0x1c4f6 Default 0x1f8b4 5975 0 akd: [com.apple.authkit:core] Attempting authorization with response <AKAuthorizationUserResponse: 0x7fcfab70c970 { selectedRequest: <AKAuthorizationRequest: 0x7fcfab713e80 { requestIdentifier: 1B1XXXX-26F2-48DF-B67B-1A25DC7XXXXX, clientID: (null), teamID: (null), userIdentifier: (null), altDSID: 001649-08-b6397585-4f42-48c7-ab85-9ce0b2XXXXX, state: (null), nonce: (null), requestedScopes: ( name, email ), appProvidedData: (null), isSilentAppTransfer: 0, }>, authorizationSelection: YES, loginChoice: 9223372036854775807, rawPassword: (**)} 2020-08-13 11:45:09.881477+0500 0x1c524 Default 0x1f8b4 6077 0 AuthKitUIService: (AuthKitUI) [com.apple.authkit:core] Selected request contains email scope. 2020-08-13 11:45:09.879095+0500 0x1c4ab Default 0x20c23 5960 0 bird: (Accounts) [com.apple.accounts:core] "ACAccountStoreClientSideListener is ignoring credential change notification because no account ID was provided." 2020-08-13 11:45:09.881529+0500 0x1c524 Default 0x1f8b4 6077 0 AuthKitUIService: (AuthKitUI) [com.apple.authkit:core] Selected request contains name scope. 2020-08-13 11:45:09.885494+0500 0x1c4f6 Activity 0x20c24 5975 0 akd: (AuthKit) authkit/fetch-url-bag 2020-08-13 11:45:09.881753+0500 0x1c524 Default 0x1f8b4 6077 0 AuthKitUIService: (AuthKitUI) [com.apple.authkit:core] AKAuthorizationConfirmPaneViewController - user authorized with scope choices: Scope Choices: scopes: ( name, email ) userinformation: <AKUserInformation: 0x6000030b40b0 { givenName: Astriks, familyName: Adscse, forwardingEmail: xxx@asas.app, accountName: xxx@asas.app, accountAliases: (null), reachableEmails: ( "xxx@asas.app" ), authorizedApplicationsListVersion: (null), masterKeyID: (null), vettedPrimaryEmail: (null), phoneAsAppleID: (null), isUnderage: 0, \^GgeOfMajority: (null), isLegacyStudent: (null), hasUsedAuthorization: 0, appleIDSecurityLevel: 0, authMode: 0, repairState: 0, selectedEmail: (null), additionalInfo: (null), }> indexOfChosenEmail: 0 indexOfChosenLogin: 9223372036854775807 wantsPrivateEmail: NO emailCount: 1 chosenEmail: xxx@asas.app forwardingEmail: xxx@asas.app userResponse: <AKAuthorizationUserResponse: 0x600000931440 { selectedRequest: <AKAuthorizationRequest: 0x600002cb4f50 { requestIdentifier: 1B18A7C2-26F2-48DF-B67B-1A25DC745788, clientID: (null), teamID: (null<…> 2020-08-13 11:45:09.885768+0500 0x1c4f6 Default 0x20c24 5975 0 akd: (AuthKit) [com.apple.authkit:core] Synchronously calling out to remote auth service to url bag 2020-08-13 11:45:09.887301+0500 0x1c4f6 Default 0x20c24 5975 0 akd: (AuthKit) [com.apple.authkit:core] Finished fetching URL bag. Error: (null) 2020-08-13 11:45:09.887438+0500 0x1c4f5 Default 0x0 5975 0 akd: (AuthKit) [com.apple.authkit:core] Connection to akd was invalidated. 2020-08-13 11:45:09.889482+0500 0x1c4f6 Default 0x1f8b4 5975 0 akd: [com.apple.authkit:core] Password available. Will ask for bootstrap password-based auth. 2020-08-13 11:45:09.900922+0500 0x1c4f6 Error 0x1f8b4 5975 0 akd: (AuthKit) [com.apple.authkit:core] AuthKit password-reset-token token is missing! Account: xxx@asas.app (D2828BEB-9F6B-406C-8A68-2A67ABA9315D). Credential: <ACAccountCredential: 0x7fcfad15fe40>. 2020-08-13 11:45:10.358454+0500 0x1c454 Default 0x1bb7e 5975 0 akd: (AuthKit) [com.apple.authkit:core] Task LocalDataTask <37A8F2C3-FF01-45C3-8AAD-23019F4EA22A>.<4> completed! Error: (null) 2020-08-13 11:45:10.358595+0500 0x1c4f5 Default 0x1bb7e 5975 0 akd: (AuthKit) [com.apple.authkit:core] Task <AKURLDataTask: 0x7fcfab4300b0, _underlylingTask: LocalDataTask <37A8F2C3-FF01-45C3-8AAD-23019F4EA22A>.<4>> Request completed with HTTP status code: 401 2020-08-13 11:45:10.358708+0500 0x1c4f5 Error 0x1bb7e 5975 0 akd: (AuthKit) [com.apple.authkit:core] Task <AKURLDataTask: 0x7fcfab4300b0, _underlylingTask: LocalDataTask <37A8F2C3-FF01-45C3-8AAD-23019F4EA22A>.<4>> Server responded with authentication error 2020-08-13 11:45:10.358777+0500 0x1c4f5 Default 0x1bb7e 5975 0 akd: [com.apple.authkit:core] Failed to execute request due to authentication error, attempting to refresh tokens and retrying 2020-08-13 11:45:10.358864+0500 0x1c4f5 Error 0x1bb7e 5975 0 akd: [com.apple.authkit:core] Failed to check in with IDMS! Error: Error Domain=AKAuthenticationError Code=-7026 "(null)" 2020-08-13 11:45:11.466642+0500 0x1c4f6 Error 0x1f8b4 5975 0 akd: [com.apple.authkit:core] Invalid/missing value for key alias: (null) 2020-08-13 11:45:11.467887+0500 0x1c4f6 Error 0x1f8b4 5975 0 akd: [com.apple.authkit:core] Invalid/missing value for key acname: (null) 2020-08-13 11:45:11.469190+0500 0x1c4f6 Error 0x1f8b4 5975 0 akd: [com.apple.authkit:core] Invalid value for key ut: (null) 2020-08-13 11:45:11.470505+0500 0x1c4f6 Error 0x1f8b4 5975 0 akd: [com.apple.authkit:core] Invalid value for key authType: (null) 2020-08-13 11:45:11.471590+0500 0x1c4f6 Default 0x1f8b4 5975 0 akd: [com.apple.authkit:core] Encoded payload for federated auth: (null) 2020-08-13 11:45:11.472669+0500 0x1c4f6 Error 0x1f8b4 5975 0 akd: [com.apple.authkit:core] Authentication with server failed! Error: Error Domain=com.apple.AppleIDAuthSupport Code=2 "M2 missing (bad password)" UserInfo={NSDescription=M2 missing (bad password), Status={ au = trustedDeviceSecondaryAuth; ec = "-24019"; ed = ""; em = "Your Apple ID is not authorized to sign in."; hsc = 409; }} 2020-08-13 11:45:11.473797+0500 0x1c4f6 Default 0x1f8b4 5975 0 akd: [com.apple.authkit:core] Auth failed but the server says to try a secondary auth action anyway. Let's how this goes... 2020-08-13 11:45:11.477038+0500 0x1c4f6 Error 0x1f8b4 5975 0 akd: [com.apple.authkit:core] Cannot store an authorization credential with nil teamID/bundleID 2020-08-13 11:45:11.478124+0500 0x1c4f6 Default 0x1f8b4 5975 0 akd: [com.apple.authkit:core] Notifying client (app.**asas) of credential state change 1. 2020-08-13 11:45:11.509433+0500 0x1c524 Fault 0x1f8b8 6077 0 AuthKitUIService: (Foundation) [com.apple.Foundation:xpc.exceptions] <NSXPCConnection: 0x6000035b0510> connection to service on pid 5975 created from an endpoint: Exception caught during decoding of reply to message 'authorizationRequestInitiatedWithUserProvidedInformation:completion:', dropping incoming message and calling failure block.

Ignored Exception: Exception while decoding argument 0 (#1 of invocation): <NSInvocation: 0x600001238680> return value: {v} void target: {@?} 0x0 (block) argument 1: {@} 0x0 argument 2: {@} 0x0

Exception: The operation couldn’t be completed. (AKAuthenticationError error -7044.) ( 0 CoreFoundation 0x00007fff23e3dcce exceptionPreprocess + 350 1 libobjc.A.dylib 0x00007fff50b3b9b2 objc_exception_throw + 48 2 Foundation 0x00007fff2589beea -[NSCoder(Exceptions) failWithExceptionName:errorCode:format:] + 0 3 Foundation 0x00007fff2589c1e9 -[NSCoder(Exceptions) failWithExternalError:] + 161 4 AuthKit 0x00007fff2fee4c2a -[AKAuthorizationCredential initWithCoder:] + 594 5 Foundation 0x00007fff25abddf3 _decodeObject + 1042 6 Foundation 0x00007fff25abe298 _decodeObjectAfterSettingWhitelistForKey + 131 7 Foundation 0x00007fff25abe2e0 -[NSXPCDecoder decodeObjectOfClasses:forKey:] + 38 8 AuthKit 0x00007fff2fee62fd -[AKAuthorization initWithCoder:] + 443 9 Foundation 0x00007fff25abddf3 _decodeObject + 1042 10 Foundation 0x00007fff25abd918 -[NSXPCDecoder _decodeObjectOfClasses:atObject:] + 63 11 Foundation 0x00007fff259d756c _NSXPCSerializationDecodeTypedObjCValuesFromArray + 998 12 Foundation 0x00007fff259d7adb _NSXPCSerializationDecodeInvocationArgumentArray + 507 13 Foundation 0x00007fff25abe64c -[NSXPCDecoder decodeXPCObject:allowingSimpleMessageSend:outInvocation:outArguments:outArgumentsMaxCount:outMethodSignature:outSelector:isReply:replySelector:interface:] + 700 14 Foundation 0x00007fff25abe36d -[NSXPCDecoder _decodeReplyFromXPCObject:forSelector:interface:] + 74 15 Foundation 0x00007fff25ab62b8 -[NSXPCConnection _decodeAndInvokeReplyBlockWithEvent:sequence:replyInfo:] + 200 16 Foundation 0x00007fff25aba80d 88-[NSXPCConnection _sendInvocation:orArguments:count:methodSignature:selector:withProxy:]_block_invoke_3 + 216 17 libxpc.dylib 0x00007fff51be68f7 _xpc_connection_reply_callout + 36 18 libxpc.dylib 0x00007fff51bdbb4f _xpc_connection_call_reply_async + 69 19 libdispatch.dylib 0x00007fff51979935 _dispatch_client_callout3 + 8 20 libdispatch.dylib 0x00007fff51991880 _dispatch_mach_msg_async_reply_invoke + 397 21 libdispatch.dylib 0x00007fff5197f47a _dispatch_lane_serial_drain + 305 22 libdispatch.dylib 0x00007fff5198007b _dispatch_lane_invoke + 443 23 libdispatch.dylib 0x00007fff5198a0c4 _dispatch_workloop_worker_thread + 626 24 libsystem_pthread.dylib 0x00007fff51b9ea3d _pthread_wqthread + 290 25 libsystem_pthread.dylib 0x00007fff51b9db77 start_wqthread + 15 ) ( 0 CoreFoundation 0x00007fff23e3dcce exceptionPreprocess + 350 1 libobjc.A.dylib 0x00007fff50b3b9b2 objc_exception_throw + 48 2 Foundation 0x00007fff259d7d91 _NSXPCSerializationDecodeInvocationArgumentArray + 1201 3 Foundation 0x00007fff25abe64c -[NSXPCDecoder decodeXPCObject:allowingSimpleMessageSend:outInvocation:outArguments:outArgumentsMaxCount:outMethodSignature:outSelector:isReply:replySelector:interface:] + 700 4 Foundation 0x00007fff25abe36d -[NSXPCDecoder _decodeReplyFromXPCObject:forSelector:interface:] + 74 5 Foundation 0x00007fff25ab62b8 -[NSXPCConnection _decodeAndInvokeReplyBlockWithEvent:sequence:replyInfo:] + 200 6 Foundation 0x00007fff25aba80d 88-[NSXPCConnection _sendInvocation:orArguments:count:methodSignature:selector:withProxy:]_block_invoke_3 + 216 7 libxpc.dylib 0x00007fff51be68f7 _xpc_connection_reply_callout + 36 8 libxpc.dylib 0x00007fff51bdbb4f _xpc_connection_call_reply_async + 69 9 libdispatch.dylib 0x00007fff51979935 _dispatch_client_callout3 + 8 10 libdispatch.dylib 0x00007fff51991880 _dispatch_mach_msg_async_reply_invoke + 397 11 libdispatch.dylib 0x00007fff5197f47a _dispatch_lane_serial_drain + 305 12 libdispatch.dylib 0x00007fff5198007b _dispatch_lane_invoke + 443 13 libdispatch.dylib 0x00007fff5198a0c4 _dispatch_workloop_worker_thread + 626 14 libsystem_pthread.dylib 0x00007fff51b9ea3d _pthread_wqthread + 290 15 libsystem_pthread.dylib 0x00007fff51b9db77 start_wqthread + 15 ) 2020-08-13 11:45:11.509638+0500 0x1c524 Error 0x1f8b4 6077 0 AuthKitUIService: [com.apple.authkit:core] listener lookup connection error Error Domain=NSCocoaErrorDomain Code=4101 "connection to service on pid 5975 created from an endpoint" UserInfo={NSDebugDescription=connection to service on pid 5975 created from an endpoint} 2020-08-13 11:45:12.152412+0500 0x1b96a Error 0x1bb31 6020 0 MyApp: (AuthKit) [com.apple.authkit:core] Authorization failed: Error Domain=AKAuthenticationError Code=-7034 "(null)" UserInfo={AKClientBundleID=app.**asas} 2020-08-13 11:45:12.151399+0500 0x1c4dc Default 0x0 5975 0 akd: [com.apple.authkit:core] Alert handle deactivated: <SBSRemoteAlertHandle: 0x7fcfab42ca00> 2020-08-13 11:45:12.151619+0500 0x1c4dc Error 0x0 5975 0 akd: [com.apple.authkit:core] Error performing auth request (<AKCredentialRequestContext: 0x7fcfab51ff80> Auth Request <AKAuthorizationRequest: 0x7fcfab514b30 { requestIdentifier: 1B18A7C2-26F2-48DF-B67B-1A25DC745788, clientID: (null), teamID: (null), userIdentifier: (null), altDSID: 001649-08-b6397585-4f42-48c7-ab85-9ce0b258c863, state: (null), nonce: (null), requestedScopes: ( name, email ), appProvidedData: (null), isSilentAppTransfer: 0, }> Password Request: (null) Proxied Bundle: (null) Proxied Team: (null)): Error Domain=AKAuthenticationError Code=-7034 "(null)" 2020-08-13 11:45:12.148868+0500 0x1c503 Error 0x0 5908 0 SpringBoard: (KeyboardArbiter) [com.apple.UIKit:KeyboardArbiter] [_UIKeyboardArbiter] Rejecting attach for <_UIKeyboardArbiterHandle: 0x600001339040; PID 5908: com.apple.springboard ; hosting PIDs {( 6077 )}; level 2.000000; active NO [wants YES]; suppression 0; iav 0.000000> (currently (null)) 2020-08-13 11:45:12.152199+0500 0x1c4f5 Default 0x0 5975 0 akd: [com.apple.authkit:core] Authorization ended for requestContext: <AKCredentialRequestContext: 0x7fcfab51ff80> Auth Request <AKAuthorizationRequest: 0x7fcfab514b30 { requestIdentifier: 1B18A7C2-26F2-48DF-B67B-1A25DC745788, clientID: (null), teamID: (null), userIdentifier: (null), altDSID: 001649-08-b6397585-4f42-48c7-ab85-9ce0b258c863, state: (null), nonce: (null), requestedScopes: ( name, email ), appProvidedData: (null), isSilentAppTransfer: 0, }> Password Request: (null) Proxied Bundle: (null) Proxied Team: (null) 2020-08-13 11:45:12.223807+0500 0x1c4dc Default 0x0 5975 0 akd: [com.apple.authkit:core] Alert handleinterrupted! : <SBSRemoteAlertHandle: 0x7fcfab42ca00> Error Domain=SBSRemoteAlertHandleInvalidationErrorDomain Code=4 "invalidated by handle request" UserInfo={NSLocalizedDescription=invalidated by handle request} `

Carsak commented 4 years ago

I have same error core] Authorization failed: Error Domain=AKAuthenticationError Code=-7034 "(null)"

  1. I added Apple Sign in parameter to my developer account image
  2. created test component with code

declare var cordova: any;

@IonicPage({ }) @Component({ selector: 'page-auth', templateUrl: 'auth.html' }) export class AuthPage { ..... many code loginbyApple() { cordova.plugins.SignInWithApple.signin( { requestedScopes: [0, 1] }, (success) => { //get email and full name from Apple ID console.warn("Авторизация прошла успешно" + success);

    let userData = {
      name: success.fullName.givenName + ' ' + success.fullName.familyName,
      email: success.email,
    };
    // this.AuthApi;
  },
  (err) => {
    console.warn("Произошла ошибка при авторизации" + JSON.stringify(err))
  }
);

} .... other code


3. Build and launch in Simulator Ios 8 13.3
4. Signed to Icloud. Enabled 2FA
5. After Singning errors appears