Sandbox Account for "Sign in With Apple"

Is there a way to get a testing account for "sign in with apple"?

Currently, it seems to be forcing my developers to tie an existing phone number to the developer accounts we are using before we can use the feature...

Post not yet marked as solved Up vote post of hoydor Down vote post of hoydor
26k views

Replies

Hi Hoydor,


Did you have any further luck on this? Or have you been restricted to testing with real live apple ids? Personally I've tried creating test users in App Store Connect but seem unable to sign in to devices using these sandbox Apple IDs to allow testing with Sign In With Apple.


Is this a known limitation to developing and testing with Sign In With Apple at present?


Thanks

What issues are you having with the sandbox test users ?


I can create them and log them in to the simulator devices (using their iCloud accounts). Unfortunately it seems that "Sign In With Apple" is requiring 2-factor authorization to be turned on and I haven't managed to do that with a sandbox test account.


Wish Apple Support would have a doc on testing "Sign In With Apple" using sandbox accounts. This is just not functional enough at this point to even do simple beta testing...


After a little digging, I created an account on my MacBook for this Sandbox test user and configured 2FA once I logged in. This allowed me to have 2FA turned on in the simulator.


I can now use "Sign In With Apple" for this sandbox user.


So to summarize the steps :


1) create sandbox user in App Store Connect

2) go to icloud.com to accept the "Terms & Conditions"

3) create a local account on your Mac (or if you have a spare phone, you can probably do step 4 via the phone) and use that sandbox ID when asked about the Apple ID.

4) from your local account, on the Mac, configure 2FA (turn it on) in : System Preferences -> Apple ID -> Password & Security (use a valid phone number to receive text messages)

5) go back to your regular account and, from Xcode, start the simulator and configure the Apple ID as that sanbox user's ID. The 2FA setting should show that it's turned on.


At that point you should be able to use "Sign In With Apple ID" from within the simulator. It's pretty tedious, but it works for me.

It is f*cking ridiculous that this is how you have to test.

Apple, it would be nice if you add sandbox mode for these:

https://appleid.apple.com/auth/token
https://appleid.apple.com/auth/authorize

..for CI environments and not only :)


The missing step for me was logging once to icloud.com, which I did thanks to @npvisual's answer here.

Try deleting the app from your Apple ID settings and you can simulate being a new user (though it seems the RealUserIndicator fails)

https://stackoverflow.com/a/59301725/1860768