Can't retrieve name and email from Sign In flow

Hi,


We've just implemented Apple Sign In according to the documentation (https://developer.apple.com/documentation/signinwithapplerestapi), the login is working fine, but there is no way to get the email from the token. We tried a lot of different scopes, and while only a few seem to be valid (name, email, openid), they don't seem to change anything to the response of the token. The only field that's in there is "id_token", and the only useful field in the "id_token" is "sub", which seems to be a unqiue identifier. Is there a way to retrieve the email address?


Thanks!

Answered by DTS Engineer in 413866022

To request user information in the `id_token` (assuming you are requesting via the `/auth/authorize` REST API), you'll need to include the `scope` query parameter, which supports the values—`name` and `email`. You can request one, both, or none.


Note: Use space separation and percent-encoding for multiple scopes; for example, `"scope=name%20email"`.


For additional information about preparing the authorization request, please see the following documentation—


https://developer.apple.com/documentation/sign_in_with_apple/sign_in_with_apple_js/incorporating_sign_in_with_apple_into_other_platforms

Hello Everyone

I am passing the name and email scope aswell but still name property is missing from the object.

any suggestions on this ?

https://appleid.apple.com/auth/token?grant_type=authorization_code&code=my_code&client_id=my_clientid&client_secret=my_client_secrate&redirect_uri=redirect_url

I am getting this type of response in id token

{
  "iss": "https://appleid.apple.com",
  "aud": "com.abc.def.dev.apple",
  "exp": 1680356668,
  "iat": 1680270268,
  "sub": "000924.ddd8b76bd42c4200ba3195d047430f95.582",
  "at_hash": "Au9BDTdPg_QshtISK4npYQ",
  "email": "abc@gmail.com",
  "email_verified": "true",
  "auth_time": 16802702287,
  "nonce_supported": true
}

I can't retrieve name and email from Sign In flow

following this

https://appleid.apple.com/auth/authorize?response_type=code%20id_token&response_mode=form_post&client_id=&redirect_uri=&scope=name%20email&state=***

how to get user's email

You need to follow this following steps

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

Any possible solutions to retrieve the user info like first and last name it's 2025 still no proper solution documented

Can't retrieve name and email from Sign In flow
 
 
Q