QuickLogin: AuthorizationCode is null
See original GitHub issueAs a follow-up to https://github.com/lupidan/apple-signin-unity/issues/132, which could be resolved by using version 1.4.2, I am still facing a problem with the QuickLogin under iOS 15.1:
My code now throws an NRE because appleIdCredential.AuthorizationCode
is null
(previously, it was always set). Note that IdentityToken
is available (not null
). Just the AuthorizationCode
is null
.
I also noticed that - if that happens - AuthorizationCode
is still null when I then try to login with the regular login, i.e. without using QuickLogin. Only if I restart the app completely, skip the QuickLogin and then use the regular Apple login, the AuthorizationCode
returns a value again.
So it seems as if QuickLogin won’t deliver an authorization code anymore, which basically breaks the functionality, as I need both tokens to login to my app. 😕
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (3 by maintainers)
Top GitHub Comments
I came around same issue. Authorization code was null when using
QuickLogin
after usingLoginWithAppleId
. I am using it to authenticate firebase and luckily firebase is ok with AuthorizationCode being null.Firebase.Auth.Credential credential = Firebase.Auth.OAuthProvider.GetCredential("apple.com", appleIdToken, rawNonce, null);
Firebase GetCredential Documentation AuthorizationCode will only be passed once, as @lupidan said. @lupidan I would suggest you to modify your firebase example with unity and make 4th parameter of GetCredential as null.I’ll leave a code for anyone wanting help on linking firebase with Apple ID
Spoiler: I am making a guest account first and then linking it with the Apple ID(Firebase) because of my game logic. You can use SignInWithCredentialAsync instead of
LinkAndRetrieveDataWithCredentialAsync
Yeah, my initial conclusion about this, is that apple just wants you to use that Authorization Code once, to get a refresh token every day, and check if the user is still valid or they have somehow revoked credentials. So it could make sense you only get it once the first time a user signs in ¿?
I’m glad to hear you sorted it out in your backend. Unfortunately there is not much we can do besides ask in the official Apple forum if this is a bug, or the expected behaviour 🤷
Closing this