Apple 说:我们只从 OIDC 标准里取了一些我们喜欢的,然后扔掉了其他的

参考《三步开发社交账号登录(以钉钉登录举例) - Jeff Tian的文章 - 知乎 》,我在自己的 App 里增加了多个社交账号登录,很是兴奋,得意地将更新提交到了 App Store。
然后被拒了,原因是如果要在 App 里增加社交登录,则必须增加 AppleID 登录,并且需要将其设置在其他社交账号方式之前。
于是,就再对接一个 Apple ID 登录,再提交更新,然后又得到了被拒绝的结果。

Your app offers Sign in with Apple as a login option but does not follow the design and user experience requirements for Sign in with Apple. Specifically:

  • Your app requires users to provide their name after using Sign in with Apple. This information is already provided by the

Authentication Services framework. These requirements provide the consistent experience users expect when using Sign In with Apple to authenticate or log in to an account.

并附上了一个截图:
image.png
即将 AppleID 登录设置了社交登录方式的首选还不行,还不能向用户询问姓名,因为使用 Apple ID 登录时,姓名会自动带过来。
为了验证这一点,我决定自己试一试,重新设置了自己的 Apple ID 资料中的姓名:
image.png
发现在 Apple ID 里还可以设置一个可选的 Middle name。不过,按照 Apple 开发者官网文档,他们只会提供 First name 和 Last name 给到开发者。
然而,测试时我发现,在 Apple ID 登录成功后,回调自己的服务器时,并拿不到用户的 Apple 姓名,只能拿到一个 email,即使设置了官网文档提到的 3 个 Scope:“name”、“openid”、“email”,并没有什么卵用。
反复验证后,才知道,用户的姓名,Apple ID 只在第一次回调开发者服务时提供,一旦账号链接建立完成,就不再提供……
也就是,当在登录授权页看到如下的界面时,开发者服务是拿不到姓名的:
image.png
这时,需要从 Apple ID 的控制面板里,断掉和开发者应用的链接(即撤销之前的授权),然后再使用 Apple ID 登录,才能获取到用户的姓名。
image.png
这时,Apple ID 对应的授权页面长这样:
image.png
折腾完毕后,忍不住为 Apple 免费设计了一个新的 LOGO:
image.png

Apple 让人又爱又恨,让我想起多年前写的打油诗:

苹果
是恶魔
夏娃受诱惑
亚当跟随堕落
就要咬一口的快乐
哪管被永世逐出天国!