Missing email in Sign in with Apple API

We’re not receiving email claim in the id token on the initial authorization request with Sign in with Apple API.

We faced this issue just 3 times, on 2 different apps with 2 different bundle IDs. This is not a persistent issue, most of the time it works fine.


Is the email always in the id token? What are the cases in which the email isn't there?

Post not yet marked as solved Up vote post of aantonioni Down vote post of aantonioni
4.1k views

Replies

Thank you for raising this issue. We too need clarification on when email is provided on initial authorization request.


We are seeing email returned as 'null' on initial request for a significant number of users.

Hi,


I'm facing the same issue. I get no name or email from id_token whereas my scopes are set to "name email" in the token request.

You got an index email with null value or nothing ? For my part, I only get :

stdClass Object

(

[iss] => xxxxxx

[aud] => xxxxxx

[exp] => xxxxxx

[iat] => xxxxxx

[sub] => xxxxxx

[at_hash] => xxxxxx

[auth_time] => xxxxxx

[nonce_supported] => 1

)


thank you.

So my team also started seeing this issue pop up around the time you posted this. It was intermittent, and we tried tracking it down but could never cause it to happen for our own accounts or test apple accounts we created. Oddly enough, someone from Apple proactively reached out to our team and told us that the Apple URL we are sending people to for them to actually sign into their apple account was using the wrong encoding for spaces. Specifically, the URL had `&scope="name+email"`, and they wanted `&scope="name%20email"`. Once we made the change, we started seeing the `email` claim on every request.


I'm not exactly sure why this would fail intermittently like it did. If it would have failed 100% of the time, it would have been a lot easier for us to figure out.


Not saying this is what is causing your problem, but just wanted to share our experience because we were having the same symptoms!

Thank you for you're answer. Unfortunately we only ask for the email in our scope so that's not our case

Same here i am unable to receive privaterelay email address i have set scope to email

We were also missing email field in case of some users. It turned out later that it depended on the device that user was using on initiall authentication through Sign in with Apple. In the mobile app it worked fine but when user was using a web browser on the initialization then the frontend team didn't define scope=email. It's forcing the response_mode=form_post and they weren't able to support a POST request in a Single Page App in JavaScript.

Too bad that Apple doesn't allow scope extension later. The scope sticks up to the point when a user reconnects his AppleId account with your app.
We have the same problem on the first connections, it seems random.
Did you find a solution?

It's still happening in 2022. Some users receive email in their id_token, othes do not.

I am facing the same issue. Everything is working as expected until the user goes to iOS settings "Password & security" and presses the "Stop using Apple ID" button for our app.

Then for any future manual sign in with that apple id (after user has logged out or reinstalled app, ...), the sign in also succeeds, but the email field in the sign in response is null and the identityToken is also a lot shorter and does not contain the email info anymore.

I have no idea how I am able to access the email info for that apple id in the sign in flow of our app again.

What am I doing wrong?

  • Never mind, my problem is only occurring when testing with Simulator... when running the app on real device, apple sign in is working as expected, even after the user stops using the apple id in the iOS security settings.

Add a Comment