美文网首页iOS 应用层
iOS 苹果授权登录(Sign in with Apple)系列

iOS 苹果授权登录(Sign in with Apple)系列

作者: 萌恬丶 | 来源:发表于2019-12-25 11:44 被阅读0次

    iOS13 中,如果 App 提供第三方登录,就必须添加 苹果登录 Sign in with Apple 选项,并要求所有开发者于 2020年4月之前 完成现有应用的更新,否则审核不给通过。

    iOS 苹果授权登录(Sign in with Apple)系列之Apple Developer配置篇

    iOS 苹果授权登录(Sign in with Apple)系列之原生篇

    iOS 苹果授权登录(Sign in with Apple)系列之uniapp篇

    iOS 苹果授权登录(Sign in with Apple)系列之服务端篇

    iOS 苹果授权登录(Sign in with Apple)系列之Apple Developer配置篇 主要写给非 iOS 开发人员(例如 uniapp 开发者)。

    登录 Apple Developer

    1、打开并登录 苹果开发者网站
    https://developer.apple.com

    2、点击 Certificates, Identifiers & Profiles 按钮


    image

    配置 Sign in with Apple

    现有 app 开启 Sign in with Apple

    1、选择左边 Identifier 栏目,在右侧选择要开通 苹果授权登录(Sign in with Apple)Identifiers 点击打开。

    https://img.wangquanwei.com/wp-content/uploads/2019/12/1576749462-1F91EBA8-DC36-4E94-8FC8-BB6C02157FE6.jpeg

    2、下拉找到 Sign In with Apple 打钩

    https://img.wangquanwei.com/wp-content/uploads/2019/12/1576752807-CD80D3D4-8FE8-424D-A1EC-1CC13681FE58.jpg

    右边的 Edit 打开会提示

    If you're enabling an App ID for the first time or for a new app, enable the App ID as a primary. You can use primary App IDs on their own or to enable identifiers for related apps and websites through grouping. To enable an App ID for a related app, (for example, an App ID for the iOS version of your Mac app), group it with the existing primary. This will also ensure that users only need to provide consent to share their information with you once for each group of apps and websites.
    
    如果首次启用应用程序ID或为新应用程序启用应用程序ID,请将该应用程序ID作为主应用程序。你可以自己使用主应用id,或者通过分组来启用相关应用和网站的标识符。要启用相关应用程序的应用程序ID(例如,Mac应用程序的iOS版本的应用程序ID),请将其与现有的主应用程序分组。这也将确保用户只需提供同意,就每组应用程序和网站与您共享一次信息。
    

    然后点击 右上角 save 保存会出现 Modify App Capabilities 弹窗 点击 Confirm

    https://img.wangquanwei.com/wp-content/uploads/2019/10/1571102938-E467EC71-3592-460C-9B9A-B99AA99E7731.jpeg
    Modify App Capabilities
    Adding or removing any capabilities will invalidate any provisioning profiles that include this App ID and they must be regenerated for future use.
    
    修改应用程序功能
    添加或删除任何功能都将使包含此应用程序ID的任何设置配置文件无效,并且必须重新生成这些配置文件以供将来使用。
    

    注:开启后 profile 将失效需要重新编辑 profile 文件

    创建新 app 并开启 Sign in with Apple

    1、创建 Identifiers

    image

    2、选择 App IDs 并点击右上角 Continue

    image

    3、在 Register an App ID 里按下图顺序操作

    image

    4、下拉在 Capabilities 里勾选 Sign In with Apple

    image

    5、点击右上角 Continue 后按钮会显示为 Register 点击即可

    Profiles

    现有 app 开启 Sign in with Apple

    现有应用在开启 Sign in with Apple 后在 ProfilesEXPIRATION 一栏会显示 Invalid

    image

    点击这一栏- Generate a Provisioning Profile 页面- Edit -点击 save
    下载新的 Profile 即可

    创建新 app 并开启 Sign in with Apple

    1、在 Profiles 栏右侧点击加号

    image

    2、Register a New Provisioning Profile 根据实际情况选择,这里作为演示选择 iOS App Development,选完点击 Continue

    image

    3、选择刚才创建的 App ID 选完点击 Continue

    image

    4、选择开发者证书如果有 For use in Xcode 11 or later 就选这个,选完点击 Continue

    image

    5、选择 允许安装 App 的设备,未勾选的将无法安装 App (选择 App Store 的无视),选完点击 Continue

    image

    6、填写描述文件名字,填写完点击 Generate

    image

    7、下载下载下载


    image

    创建秘钥

    1、选择左边 Keys 栏目,创建用于客户端身份验证的私钥,点击 Create a Key

    image

    2、按下图步骤操作

    image

    3、选择 App ID 并保存

    image

    4、在 Register a New Key 页面点击 Continue

    没错!这里没图

    5、点击 Register

    image

    6、密钥仅能下载一次,下载的文件将以.p8结尾,建议将其重命名为key.txt以便在后续步骤中更轻松地使用

    After downloading your key, it cannot be re-downloaded as the server copy is removed. If you are not prepared to download your key at this time, click Done and download it at a later time. Be sure to save a backup of your key in a secure place.
    
    下载密钥后,由于服务器副本已被删除,因此无法重新下载。如果此时您还没有准备好下载密钥,请单击Done,稍后再下载。请务必将您的密钥备份保存在安全的地方。
    

    image
    前方高能
    前方高能
    前方高能
    Key ID 在基于授权码的验证中会用到,具体见
    iOS 苹果授权登录(Sign in with Apple)系列之服务端篇

    相关文章

      网友评论

        本文标题:iOS 苹果授权登录(Sign in with Apple)系列

        本文链接:https://www.haomeiwen.com/subject/nkccoctx.html