Skip to content
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

Credential always REVOKED ios18+ Simulator (workaround: use iOS17 or ignore status) #356

Closed
gabemeola opened this issue Oct 27, 2024 · 11 comments

Comments

@gabemeola
Copy link

In ios 18, calling appleAuth.getCredentialStateForUser(userId) always returns REVOKED (0)

@KamranZafar19
Copy link

@gabemeola have find out the solution?

@hgrami
Copy link

hgrami commented Nov 13, 2024

@gabemeola any solution yet anyone? Right now I'm just ignoring that state for version 18, but I need a better solution.

const iOSMajorVersion = parseInt(Platform.Version as string, 10);

if (credentialState === appleAuth.State.AUTHORIZED || iOSMajorVersion === 18) {
     // send auth to backend
}

@mikehardy
Copy link
Collaborator

I see revoked in the Simulator but it works on device
I couldn't figure out any reason for it, all I can think of is that it is (yet another) Simulator vs real device difference
In my experience you cannot rely on the Simulator for the final say in Apple testing, and especially with apple auth

Unfortunately, I believe Apple tests apps on Simulators when submitted to the App Store, so you do have to handle it.

Has anyone experienced this on real devices, or like me just simulator only ?

@eyupkoc29
Copy link

eyupkoc29 commented Nov 19, 2024

There is a problem with iOS 18.1, I am testing it on iPhone 13 mini Simulator, the credential state is revoked. For this reason, the application is not approved.

[Apple Sign In] Credential State: 0

@mikehardy
Copy link
Collaborator

@eyupkoc29 sorry for being very very precise here: but I assume when you say "iPhone 13 mini" you mean "a real physical iPhone 13 mini device", that is you do not mean "an iOS simulator iPhone 13 mini"

I think what you wrote is pretty clear but I have to make sure, because I tested on a real iPhone SE2 device and it seemed I got the correct credential state using the test app in this repository. I only saw the (bizarre, to me) revoked credential on the test app in the simulator.

@eyupkoc29
Copy link

sorry for being very very precise here: but I assume when you say "iPhone 13 mini" you mean "a real physical iPhone 13 mini device", that is you do not mean "an iOS simulator iPhone 13 mini"

I think what you wrote is pretty clear but I have to make sure, because I tested on a real iPhone SE2 device and it seemed I got the correct credential state using the test app in this repository. I only saw the (bizarre, to me) revoked credential on the test app in the simulator.

I encountered this issue on the simulator, and since I don’t have an iPhone 13 Mini for physical testing, I couldn’t verify it properly. As a result, the app was rejected on the App Store.

@mikehardy
Copy link
Collaborator

Ah ha! I am really glad I asked then. As far as I can see, the simulator always returns revoked for the credential right now (testing iOS 18.1 / current as of this typing). I have no idea why, anyone that looks on stackoverflow or in the apple issue tracker and posts information would be a hero.

Also, anyone that tested various iOS versions to see how they respond would also be a hero. I believe (but needs confirmation) that this was working in iOS 16.x and iOS 17.x. I am not sure about 18.0. 18.1 appears to always have the credential revoked.

Note that on a real device it works, I tested the example app without changes on an iOS 18.1 simulator and an iOS 18.1 iPhone SE2 real device and I got credential revoked on simulator and credential ok on real device.

I can only explain that by assuming the iOS 18.1 simulator has a bug.

If we can determine a version that works, you can leave instructions in your app submission to test with a specific version that works (like, 17.whatever), and they should accept that, especially if you link an apple developer forum issue where others document + discuss the issue.

@eyupkoc29
Copy link

Ah ha! I am really glad I asked then. As far as I can see, the simulator always returns revoked for the credential right now (testing iOS 18.1 / current as of this typing). I have no idea why, anyone that looks on stackoverflow or in the apple issue tracker and posts information would be a hero.

Also, anyone that tested various iOS versions to see how they respond would also be a hero. I believe (but needs confirmation) that this was working in iOS 16.x and iOS 17.x. I am not sure about 18.0. 18.1 appears to always have the credential revoked.

Note that on a real device it works, I tested the example app without changes on an iOS 18.1 simulator and an iOS 18.1 iPhone SE2 real device and I got credential revoked on simulator and credential ok on real device.

I can only explain that by assuming the iOS 18.1 simulator has a bug.

If we can determine a version that works, you can leave instructions in your app submission to test with a specific version that works (like, 17.whatever), and they should accept that, especially if you link an apple developer forum issue where others document + discuss the issue.

I’m not sure if it will be helpful, but when I tried Expo’s package, I faced the same issue again.

@mikehardy
Copy link
Collaborator

That just confirms (for me at least) this is yet-another-apple-authentication-simulator bug. Which is really hard to deal with because the Apple employees use the Apple Simulator for App Review. And Apple requires Sign-In With Apple in your App if you allow any social auth (which everyone does...). So this just blocks everyone.

Last time that happened we all had to put specific instructions in the App Review submission notes telling the reviewers to use a specific Simulator iOS version and why. We'll likely have to do the same here if this is affecting you but first we need someone to determine the last known-good version of iOS for the simulator. Also we'll need to determine if the credential revocation really matters - maybe you can just code around it? It does log you in after all, just with a revoked credential...and you can tell you are on the Simulator I think...

@mikehardy mikehardy changed the title appleAuth.getCredentialStateForUser always returns REVOKED in ios18 Credential status always REVOKED in ios18+ Simulator / have to use iOS17 Simulator Nov 20, 2024
@mikehardy mikehardy pinned this issue Nov 20, 2024
@mikehardy
Copy link
Collaborator

mikehardy commented Nov 20, 2024

Okay, I checked it today.
The iOS17 emulators work fine for credential status.
iOS18/18.1 simulators are broken, they will always return credential status revoked

As a workaround, if your app can detect it is on a simulator and is an affected version (for instance, with react-native-device-info isEmulator and getSystemVersion()) then you can ignore that and proceed as normal, so your app will pass review.

Alternatively, you may instruct the reviewer that credential revocation status is incorrect on iOS18/18.1 and testing must be performed on an iOS17 simulator

image

I have pinned this issue and updated the title to hopefully help others
However this is not actionable here at all, so I will close it - I understand it isn't fixed but we can't fix it, we can only workaround broken Simulators. Not the first time (remember #141 ?), won't be the last I'm sure

@mikehardy mikehardy changed the title Credential status always REVOKED in ios18+ Simulator / have to use iOS17 Simulator Credential always REVOKED ios18+ Simulator (workaround: use iOS17 or ignore status) Nov 20, 2024
@mikehardy
Copy link
Collaborator

mikehardy commented Nov 20, 2024

I opened a developer forum thread here, waiting to be approved+published at the moment but hopefully will be visible soon: https://developer.apple.com/forums/thread/769231

I have not logged an apple issue or anything but perhaps someone else could and they could comment? This issue here is closed because it is not really actionable but sharing useful information is encouraged.

Please please please no "me too"s or "+1"s though, those are notification spam. Just add to the conversation if you are really moving it forward with new information. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants