New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
getCredentialState returned an error: The operation couldn’t be completed. (com.apple.AuthenticationServices.AuthorizationError error 1000.) #7
Comments
@pedro371, I had the same problem. The Example Project in the code ran fine which pointed me to to my xcode config. My mistake was not adding the "Sign In with Apple" Capability to all the target outputs. i.e. I added the capability to "Profile" but not the "Debug" output. |
@wbmartin Thank your for your answer, but I added the capability... |
Did you find a solution? I have exactly the same problem when trying to implement it. First time I was able to sign in successfully - then I logged out and it doesn't work anymore when I'm trying to sign in again. EDIT: Correction - repeated login authorization works fine. My code was crashing because I'm saving givenName and familyName. The issue is that fields contained data only during my first login. Now it always returns NULL. It returns only credential.user "token" after successful authorization. I'm not sure why fullName fields are empty...
|
Hello, thank you for your answer. Im using the code of the example in my app and the example just saves the userID. Can you run the example without errors? |
Yes, the example code works fine. I receive the mentioned error:
only when running in Simulator. When running on physical device it works fine. Tested on iPad Pro 11" and iPhone 11 Pro Max. |
hey guys did you solving for this problem cuz it happened to me |
me also face this issue and remove checkLoggedInState() method now it is working fine I use this only :::: Future appleLogIn() async {
|
not working for me have you any suggestions?
…On Mon, 23 Dec 2019 at 10:00, sarbjeetromanadhaliwal < ***@***.***> wrote:
me also face this issue and remove checkLoggedInState() method now it is
working fine
I use this only ::::
Future appleLogIn() async {
if(await AppleSignIn.isAvailable()) {
final AuthorizationResult result = await AppleSignIn.performRequests([
AppleIdRequest(requestedScopes: [Scope.email, Scope.fullName])
]);
switch (result.status) {
case AuthorizationStatus.authorized:
print("status=${result.status}");
print("email=${result.credential.email}");
print("fullname=${result.credential.fullName.familyName}");
print("fullname=${result.credential.fullName.givenName}");
print("user=${result.credential.user}");
print("realuserstatus=${result.credential.realUserStatus}");
break;//All the required credentials
case AuthorizationStatus.error:
print("Sign in failed: ${result.error.localizedDescription}");
break;
case AuthorizationStatus.cancelled:
print('User cancelled');
break;
}
}else{
print('Apple SignIn is not available for your device');
}
}
and no use this
void checkLoggedInState(String userId) async {
if (userId == null) {
print("No stored user ID");
return;
}
final credentialState = await AppleSignIn.getCredentialState(userId);
switch (credentialState.status) {
case CredentialStatus.authorized:
print("getCredentialState returned authorized");
break;
case CredentialStatus.error:
print(
"getCredentialState returned an error: ${credentialState.error.localizedDescription}");
break;
case CredentialStatus.revoked:
print("getCredentialState returned revoked");
break;
case CredentialStatus.notFound:
print("getCredentialState returned not found");
break;
case CredentialStatus.transferred:
print("getCredentialState returned not transferred");
break;
}
}
Future appleLogIn() async {
if (await AppleSignIn.isAvailable()) {
final AuthorizationResult result = await AppleSignIn.performRequests([
AppleIdRequest(requestedScopes: [Scope.email, Scope.fullName])
]);
switch (result.status) {
case AuthorizationStatus.authorized:
print("status=${result.status}");
checkLoggedInState(result.credential.user);
break; //All the required credentials
case AuthorizationStatus.error:
print("Sign in failed: ${result.error.localizedDescription}");
break;
case AuthorizationStatus.cancelled:
print('User cancelled');
break;
}
} else {
print('Apple SignIn is not available for your device');
}
}
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#7?email_source=notifications&email_token=ANEQJ6PZMQJVJ6RC5XUXAETQ2BVYRA5CNFSM4JF7WD42YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHQQB5A#issuecomment-568393972>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ANEQJ6NWXH76PFW4AAWI5ULQ2BVYRANCNFSM4JF7WD4Q>
.
|
you did apple sign in enable in xcode in Runner? i did from this link https://medium.com/smartters-studio/flutter-login-with-apple-3a98582f53a1 |
sarbjeetromanadhaliwal
yes i enabled in xcode
![2019-12-24 at 9 46 AM](https://user-images.githubusercontent.com/55117049/71401575-f5116680-2632-11ea-9cfb-da610dc0dfd6.png)
|
muhmmedAbdelkhalik can you share your code? then i do something.. |
Here is my code @sarbjeetromanadhaliwal , and i tried with another account apple and it same
|
@muhmmedAbdelkhalik you can get the detail from your server where your register the data using result.credential.user |
I'm having this same issue, with the simulator (haven't had a chance to test it on a device yet). Signing in works fine, and I get a user id just fine, but when I check the credentialState with (from CredentialStatus.error) (Also mentioned in the console): if I'm logged in to the phone, I get this error: if I'm logged out of the phone, I get this error: It's almost enough information to make my decision to log the user out or not based on whether the error code is 7073 or 7022, but I'm not sure if that would be reliable. The capability is added in release, debug, and profile (logging in does work, just not checking if the user is still logged in to Apple on their phone). I don't know what the error codes 7073 and 7022 mean and I can't find any information on it. EDIT The |
muhmmedAbdelkhalik do you solve the problem? |
it's n't problem because i have login before and it save automatic |
@muhmmedAbdelkhalik i have a question pertaining to this issue
|
I am having this issue after I upgraded flutter to 1.20.1 (Not sure if this is causing the issue). |
please reopen this issue |
I was dealing with exactly this issue for an hour because... i didn't have the internet connection! I didn't get descriptive error for something that simple... |
any news ? |
I currently face this issue... In production and only for new users. That's very strange since it worked perfectly for the past year. Any idea? |
Hello guys,
when I sign in into the example, close the App and restart it, I always getting this error code:
2019-10-30 20:02:45.012873+0100 Runner[76206:1907400] [core] Credential State request returned with error: Error Domain=AKAuthenticationError Code=-7001 "(null)"
2019-10-30 20:02:45.107926+0100 Runner[76206:1907406] flutter: getCredentialState returned an error: The operation couldn’t be completed. (com.apple.AuthenticationServices.AuthorizationError error 1000.)
`[✓] Flutter (Channel master, v1.10.15-pre.285, on Mac OS X 10.15 19A602, locale de-DE)
• Flutter version 1.10.15-pre.285 at /Users/pedrolopes/Documents/workspace/flutter
• Framework revision 38f2d27685 (2 hours ago), 2019-10-28 11:28:09 -0700
• Engine revision 869b74eb4e
• Dart version 2.6.0 (build 2.6.0-dev.8.2 5b7c981086)
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
• Android SDK at /Users/pedrolopes/Library/Android/sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-28, build-tools 28.0.3
• Java binary at: /Applications/Android
Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 11.0)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 11.0, Build version 11A420a
• CocoaPods version 1.8.3
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 3.2)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 31.3.1
• Dart plugin version 181.5656
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)
[✓] VS Code (version 1.39.2)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.5.1
`
@tomgilder Do you have any idea?
The text was updated successfully, but these errors were encountered: