25

So I'm implementing sign in with Apple, everything goes well on the simulator, I request email, fullName scopes, the authenticate UI shows, and I can get the data, as images shown below:

enter image description here enter image description here

But when testing on real device (iPadOS 13, iPad 2018), the UI didn't show (it does not asks for name and email on the UI), and I can't get the email, fullName from the response, and I can also confirm that the authorizedScopes are empty, I can only get the user identifier

enter image description here enter image description here

I believe this is a bug and will file a radar, also posted a discussion on the Apple developer forum (but they usually won't approve my post, I don't know why)

If this is not a bug, can somebody tell me how to fix this? Thanks

3
  • 2
    I am having the same issue, whats your radar number? It seems to be related to cached auth responses. If you go to "Settings > iCloud > Password & Security > Sign in With Apple" and delete the authorization, it works. But if you auth again, it fails with empty scopes. Aug 22, 2019 at 14:16
  • @HansKnöchel Seems like this is more likely a feature instead of a "bug", haven't filed an open radar yet, but somebody answered my question on the Apple Developer Forum, check this link for more info: forums.developer.apple.com/thread/121496.
    – Johnny
    Aug 23, 2019 at 7:30
  • @HansKnöchel Problem solved! See my answer
    – Johnny
    Aug 29, 2019 at 2:51

2 Answers 2

29

Problem solved! tl;dr

This is an expected behavior

Answered by Apple Engineer (Original post link: https://forums.developer.apple.com/thread/121496)

Hi aslkdjalksdjasdasd,

This behaves correctly, user info is only sent in the ASAuthorizationAppleIDCredential upon initial user sign up. Subsequent logins to your app using Sign In with Apple with the same account do not share any user info and will only return a user identifier in the ASAuthorizationAppleIDCredential. It is recommened that you securely cache the initial ASAuthorizationAppleIDCredential containing the user info until you can validate that an account has succesfully been created on your server.

Patrick

2019/12/15 Edit

This behavior is also documented on Apple's Sign in with Apple doc, check the documentation.

Ensure that your app relays the credentials and user information to your app servers. The API collects this information and shares it with your app the first time the user logs in to the app using Sign in with Apple. If the user then uses Sign in with Apple on another device, the API doesn't ask for the user’s name or email again. It collects the information again only if the user stops using Sign in with Apple and later reconnects to your app.

2
  • 6
    Hi, if the user already used sign in with apple and then our server return error cause our server detect the username length is didn't meet our condition and than our code didn't cache the user information. how can i solve this? without telling user to stop using apple id from setting page? Thank you,
    – MNFS
    Feb 13, 2020 at 7:59
  • I deleted the app from the appleId.apple.com and start fresh. I do request for name and email scope, but only receive the email, the name is not real, it's an identifier. I do have a mechanism to store this the first time. But, not sure how to reset all of this. Jan 20, 2021 at 4:32
24

If someone fails in storing "user email", "first-name" first time, then he should follow the following steps:

iPhone Settings -> Apple Id -> Password & Security -> Apple ID logins -> {YOUR APP} > Stop using Apple ID.

3
  • 2
    Some text seem changed in iOS 14, on my phone the flow looks like this: Settings -> Apple ID (the very top row with your avatar image) -> Password & Security -> Apps using Apple ID -> {APP NAME or BUNDLE ID} > Stop using Apple ID
    – Daniel Hu
    Oct 20, 2021 at 22:15
  • I successfully did Stop using Apple ID for my test account with my app, and removed the user from the database manually. But still I cannot force the app to go into the original flow and thus am unable to retrieve the email and fullName. This surprising default behaviour makes it difficult to develop and test :(
    – DaReal
    Dec 3, 2022 at 21:47
  • Found the answer as to why it was not working for me. I was using an old abandoned apple_sign_in package. Use the sign_in_with_apple package instead, and the proposed solutions will work. See stackoverflow.com/questions/74671355/…
    – DaReal
    Dec 4, 2022 at 0:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.