前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Sign in with Apple

Sign in with Apple

原创
作者头像
冬冬吧
修改2020-06-02 17:32:55
1.9K0
修改2020-06-02 17:32:55
举报
文章被收录于专栏:iOS应用开发iOS应用开发

背景

自苹果推出了 Sign in with Apple 功能后,很快审核指南就加入 4.8 :使用第三方登录的App,都必须接入AppleID登录 。已经上架的 App 需在 2020 年 4 月 前完成接入工作, 新老App一样对待。

基本流程

image.png
image.png

App

1.首先需要配置Sign In with Apple

image.png
image.png

2.生成私钥。勾选Sign In with Apple,->Configure,选择Primary App ID,生成新的.p8私钥。

image.png
image.png
image.png
image.png

3.项目中配置Capability

image.png
image.png

4.集成AuthenticationServices.

  • 官方提供了 ASAuthorizationAppleIDButton (继承自UIControl),来创建按钮。 private let appleButton: ASAuthorizationAppleIDButton = { let button = ASAuthorizationAppleIDButton(authorizationButtonType: .signIn, authorizationButtonStyle: .white) return button }()
  • 按钮样式有whitewhiteOutlineblack 三种,Api部分比较简单,直接看代码就好了。
  • 值得一提的是,现在Apple明显严肃了对AppleID登录功能的UI规范审核,听闻很多小伙伴的App也都因这个问题而审核被拒,我这里也提一下。基本小伙伴收到的都是下面的这种被拒原由: Guideline 4.0 - Design We noticed an issue in your app that contributes to a lower quality user experience than Apple users expect:
  • Your app uses Sign in with Apple as a login option but does not use Sign in with Apple button design, branding and/or user interface elements appropriately as described in the Sign in With Apple Human Interface Guidelines. 这个问题,只要大家认真阅读https://developer.apple.com/design/human-interface-guidelines/sign-in-with-apple/overview/buttons并按照上面的要求修改,都不会再有问题。
  • ASAuthorizationAppleIDCredential信息释义: User ID: 苹果用户唯一标识符,该值在同一个开发者账号下的所有 App 下是一样的,开发者可以用该唯一标识符与自己后台系统的账号体系绑定起来。 Verification data: Identity token, code验证数据,用于传给开发者后台服务器,然后开发者服务器再向苹果的身份验证服务端验证本次授权登录请求数据的有效性和真实性 Account information: 苹果用户信息,包括全名、邮箱等 Real user indicator: 用于判断当前登录的苹果账号是否是一个真实用户

AuthenticationServices 框架概述

  • 1.Sign In with Apple 使用Apple 登录
  • 2.Password-Based Login 基于密码的登录
  • 3.Web-Based Login 基于web的登录
  • 4.Enterprise Single Sign-On 企业单点登录SSO
  • 5.AutoFill Credential Provider Support自动填充验证提供者支持
  • 6.Web Browser Authentication Session Support web 浏览器认证会话支持
image.png
image.png

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 背景
  • 基本流程
  • App
  • AuthenticationServices 框架概述
相关产品与服务
访问管理
访问管理(Cloud Access Management,CAM)可以帮助您安全、便捷地管理对腾讯云服务和资源的访问。您可以使用CAM创建子用户、用户组和角色,并通过策略控制其访问范围。CAM支持用户和角色SSO能力,您可以根据具体管理场景针对性设置企业内用户和腾讯云的互通能力。
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档