iOS: "Sign in with Apple" state does not restore after app restart

I'm using "Sign in with Apple" in my iOS app. I'm pretty much following the boilerplate code from https://developer.apple.com/documentation/authenticationservices/implementing_user_authentication_with_sign_in_with_apple, and all seems to be working fine for logging in:

I get a guid-looking identifier in appleIDCredential.user which I store persistently, as well as the user's name and email (if provided).

the problem, is when I kill and restart my my "production" app (a "app store ready" release build, from test flight, but with extra logging), i reload the user identifier and I can confirm in Console.app that it's the same as was stored in the previous run, *but* getCredentialState always returns 2, "not found".

if I manually log in again, I get then same identifier as before, but on next relaunch, I still get "not found" and have to log in again.

what could be going on, what could I be missing?

I'm testing on iOS 13.0 thru 13.6, also 14.0 beta, same everywhere, since day one.

Replies

ps: i'm getting two conflicting messages:

Credential State request returned with error: Error Domain=AKAuthenticationError Code=-7073

this is printed to the console and

credentialState 2, error Domain=com.apple.AuthenticationServices.AuthorizationError Code=1000 "(null)"

this is the error message i'm getting back in the callback (different codes? why?)
Same problem. Also getting Error Domain=AKAuthenticationError Code=-7073 when I use my account. Might try using my sibling's account to see if it's my Apple ID specifically that's the problem or the app.
In my app (www DOT curacaoweatherapp DOT com — Jesus, you can't post links?), I see it on all devices, and from different user accounts. :(
Looks like 1000 is "Unknown". yay, very helpful :(

public enum AuthenticationServices.ASAuthorizationError {
case unknown = 1000
case canceled = 1001
case invalidResponse = 1002
case notHandled = 1003
case failed = 1004
}
We are also having the same problem

Credential State request returned with error: Error Domain=AKAuthenticationError Code=-7073

didCompleteWithAuthorization is called, the app can login, but we cannot check the user login state using getCredentialStateForUserID.
Could someone help us look into this, we don't want user to re-login every time he/she starts the app.

Hello all,

Did you manage to find a solution to this? I am having the same issue :(

Kind regards, Panos