【三方登录-Apple】iOS 苹果授权登录(sign in with Apple)之开发者配置一

记录一下sign in with Apple的开发者配置

前言

关于使用 Apple 登录 使用"通过 Apple 登录"可让用户设置帐户并使用其Apple ID登录您的应用程序和关联网站。首先使用"使用

Apple 登录"功能启用应用程序的App ID 。 如果您是首次启用应用程序 ID 或为新应用程序启用应用程序 ID,请启用该应用程序

ID 作为主要应用程序 ID。您可以单独使用主应用程序 ID,也可以通过分组为相关应用程序和网站启用标识符。 要为相关应用程序启用应用程序

ID(例如,Mac 应用程序的 iOS 版本的应用程序 ID),请将其与现有主应用程序分组。如果您的应用程序具有适用于多个 Apple

平台或您想要启用"使用 Apple 登录"功能的 Web 的版本,这会很有帮助。通过与现有主标识符分组而启用的应用程序 ID

不能用于通过分组启用其他标识符。您需要取消应用程序 ID 的分组并将其启用为主要应用程序 ID。

您可以通过在证书、标识符和配置文件中编辑应用程序 ID 配置来管理应用程序 ID 。

一、配置Sign in with Apple

1.找到证书

2.创建新 app(web已有做关联) 并开启 Sign in with Apple

3.接下来新建一个新的 identifier,注意是 Services IDs

  • 1、创建 Identifiers

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

  • 3、按下图顺序操作

4.接下来在Configure 配置回调地址

确保 Primary App ID 是你要选用的app

注意回调地址那里的链接必须要有 https 开头

5.设置完成,页面显示无误后可以选取左边的 Key

  1. 创建keyId

  2. 先选这个key关联到你的主app,然后点击continue,

  3. 获取keyid

怎么找到Sign in with Apple 回调地址?

1.Certificates, Identifiers & Profiles->Identifiers->右侧搜索筛选Services IDs

现在,你获得了 service ID, redirect URL, team ID, key ID, and private key. 接下来就可以开始第二部分 Sign In with Apple REST API.

clientId 是申请的serveic IDs 中的那个 identifier

6.网页前端配置

javascript 复制代码
<button id="sign-in-with-apple-button"> Sign In with Apple </button>
<script type="text/javascript" src="https://appleid.cdn-apple.com/appleauth/static/jsapi/appleid/1/en_US/appleid.auth.js"></script>
<script type="text/javascript">
    AppleID.auth.init({
        clientId : 'xxxx',
        scope : 'email',
        redirectURI: 'https://dogfightx.com/',
        state : 'DE'
    });

    const buttonElement = document.getElementById('sign-in-with-apple-button');
    buttonElement.addEventListener('click', () => {
        AppleID.auth.signIn();
    });
</script>
相关推荐
恋猫de小郭5 小时前
小米 HyperOS 4 大变样?核心应用以 Rust / Flutter 重写,不兼容老系统
android·前端·人工智能·flutter·ios
June bug5 小时前
【领域知识】一个休闲游戏产品(安卓和iOS)从0到1
android·ios
2501_915106326 小时前
iOS 如何绕过 ATS 发送请求,iOS调试
android·ios·小程序·https·uni-app·iphone·webview
鹏北海-RemHusband6 小时前
踩坑记录:iOS Safari 软键盘下的“幽灵弹窗“问题
前端·ios·safari
徐赛俊18 小时前
IOS快捷指令:一键静音 / 恢复
ios
2501_9159184121 小时前
常见 iOS 抓包工具的使用,从代理抓包、设备抓包到数据流抓包
android·ios·小程序·https·uni-app·iphone·webview
handsome09161 天前
uniapp打包的app,报This app was built with the iOS 18.1 SDK解决方案
ios·uni-app
初级代码游戏1 天前
iOS开发 SwiftUI 15:手势 拖动 缩放 旋转
ios·swiftui·swift
森之鸟1 天前
iOS云打包之Shorebird
ios
GuokLiu1 天前
260203-OpenWebUI-在Windows上和RHEL上部署Caddy的步骤+在iPhone上操作的步骤
windows·ios·iphone