Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot get name & email with sign in with Apple on real device

Tags:

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

like image 678
Johnny Avatar asked Aug 18 '19 14:08

Johnny


People also ask

What is Asauthorizationappleidprovider?

An OpenID authorization request that relies on the user's Apple ID.

How do I sign in with my Apple name?

If you request the user's full name, Sign in with Apple collects the information to pass along to your app. The name defaults to the user's name from their Apple ID, but the user can change their name. Apple doesn't receive the user's full name shared with the system UI.

How do I use Apple hidden email?

In Safari: Open a website, tap in an email field, then tap Hide My Email above the keyboard to generate a new random email address or use one you've already created for the website. In Mail: (iOS 15.2, iPadOS 15.2, or later) Open a new message window, tap the From field, then choose Hide My Email in the pop-up menu.

How do I stop Apple from hiding my email?

Go to Settings > [your name] > iCloud > Hide My Email, then do any of the following: Create a Hide My Email address: Tap Create New Address, then follow the onscreen instructions. Deactivate a Hide My Email address: Tap an address (below Create New Address), then tap Deactivate Email Address.


2 Answers

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.

like image 77
Johnny Avatar answered Sep 21 '22 13:09

Johnny


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.

like image 41
Hamza Javaid Avatar answered Sep 17 '22 13:09

Hamza Javaid



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!