-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
馃悰 Bug Report: Sign in with Apple, user name should not be email #7268
Comments
I'm not familiar with php but I think the problem is caused by the getUserName function: appwrite/src/Appwrite/Auth/OAuth2/Apple.php Lines 161 to 173 in 5a715ff
it does not return the name in any case, the modified version should look like this: public function getUserName(string $accessToken): string
{
if (
isset($this->claims['email']) &&
!empty($this->claims['email']) &&
isset($this->claims['email_verified']) &&
$this->claims['email_verified'] === 'true'
) {
// If the user has email and the email is verified
return isset($this->claims['name']) ? $this->claims['name'] : $this->claims['email'];
}
return '';
} |
@canbi, thanks for raising this issue! 馃檹馃徏 It looks like a lot of the confusion happens because the name isn't always returned. @matee-safi, have you confirmed what's in the { "name": { "firstName": "string", "lastName": "string" }, "email": "string" } |
@stnguyen90 No I haven't but you are right the solution is a bit more complex than I imagined, thank you for clarifying 馃檹 |
@stnguyen90 Let me try to solve it ;) You can assign me. |
@behics, assigned! Thanks for your interest! Related discord thread: https://discord.com/channels/564160730845151244/1206906875245887528 |
So, it looks like the user's name is only returned when:
This is very different from how all the other OAuth2 providers work and would require us to update the params of the OAuth2 callback and OAuth2 redirect to have the I'll need to talk to the team to see if we want to move forward with this. |
We're hesitating with adding an additional parameter to the endpoint just for Apple because it's not very scalable. What if another provider has another param tomorrow? We need to think about other possible options to handle this better. |
馃憻 Reproduction steps
Sign in with Apple to any app, you will get user information, in this information you get email as name instead of name itself.
Scope details for Sign in with Apple: ['email', 'name']
馃憤 Expected behavior
In Sign in with Apple, only on first time login/registration does the app get the name information (if the user has given permission to share). For logins after the first login, the name information is blank (Apple only provides this information the first time). The developer must handle the name information themselves.
馃憥 Actual Behavior
Name information always comes as an e-mail.
馃幉 Appwrite version
Version 1.4.x
馃捇 Operating system
Linux
馃П Your Environment
One-click Digital Ocean droplet
馃憖 Have you spent some time to check if this issue has been raised before?
馃彚 Have you read the Code of Conduct?
The text was updated successfully, but these errors were encountered: