laravel-sign-in-with-apple icon indicating copy to clipboard operation
laravel-sign-in-with-apple copied to clipboard

Name and Surname

Open markonikolicdir opened this issue 3 years ago • 8 comments

Hello,

I am using this lib and it is working very good but missing data about user when user logging from mobile app.

I saw in method mapUserToObject that you are taking from the request firstName and lastName.

Is only solution for this to grab it from mobile app?

In Apple doc I didn't find firstName or lastName.

https://developer.apple.com/documentation/sign_in_with_apple/sign_in_with_apple_rest_api/authenticating_users_with_sign_in_with_apple

markonikolicdir avatar Jun 10 '22 11:06 markonikolicdir

The same issue I have when I try to get the name from the user object.

$user = Socialite::driver("sign-in-with-apple")->user();
dd($user->getName()); // is empty

kitro avatar Oct 04 '22 09:10 kitro

i belive you have to add the scopes, which is mentioned on the readme. Did this not work?

Socialite::driver("sign-in-with-apple")
            ->scopes(["name", "email"])
            // ...

mikebronner avatar Oct 04 '22 15:10 mikebronner

i belive you have to add the scopes, which is mentioned on the readme. Did this not work?

Socialite::driver("sign-in-with-apple")
            ->scopes(["name", "email"])
            // ...

Thank you for your reply, I tested with and without the scopes when I try to get the name is always null.

kitro avatar Oct 04 '22 15:10 kitro

hmmm, that is odd ... I will have to test this again.

mikebronner avatar Oct 04 '22 16:10 mikebronner

I have the same issue when I use it like this: Socialite::driver('sign-in-with-apple')->userFromToken($data['access_token']);

somarkn99 avatar Oct 09 '22 22:10 somarkn99

This the user objected returned, I submitted the request with the scopes name and email. image

kitro avatar Oct 19 '22 13:10 kitro