首页> 软件配置及服务 >第三方通道配置 第三方通道配置

Apple第三方网页授权登录-OAuth客户端创建配置流程

作者:小萝卜 2025-04-04 浏览 118

简介Apple相对于google配置的流程要复杂很多,创建 App ID,创建 Service ID(用于网页登录),生成 Private Key(用于 JWT 签名)

以下是配置 Apple 第三方网页登录的详细流程,分步骤说明:



1. 准备工作

  • Apple 开发者账号:确保已注册 Apple Developer Program(年费约 $99)。

  • HTTPS 域名:网页必须使用 HTTPS,且域名已验证所有权。

  • 服务端能力:需后端处理 Apple 的回调、JWT 验证和用户数据存储。



2. 创建 App ID

  1. 登录 Apple 开发者后台

  2. 进入 Certificates, Identifiers & Profiles → Identifiers → +

  3. 选择 App ID → 填写 Description 和 Bundle ID(格式:com.yourcompany.appname)。

  4. 勾选 Sign In with Apple → Continue → Register



3. 创建 Service ID(用于网页登录)

  1. 在 Identifiers 页面 → + → 选择 Services IDs → Continue

  2. 填写信息:

    • Description:网页服务名称(如 "Web Login")。

    • Identifier:格式 com.yourcompany.service(作为 client_id 使用)。

  3. 勾选 Sign In with Apple → Configure

    • Domains:输入网页的域名(如 yourdomain.com)。

    • Return URLs:填写回调地址(如 https://yourdomain.com/auth/apple/callback)。

  4. 完成配置 → Continue → Register



4. 生成 Private Key(用于 JWT 签名)

  1. 进入 Keys → + → 输入 Key Name(如 "Apple Web Auth Key")。

  2. 勾选 Sign In with Apple → Configure → 选择之前创建的 Primary App ID

  3. Confirm → Continue → Register → 下载 .p8 私钥文件(仅一次机会)。

记录以下参数

  • Key ID:下载页面显示的密钥 ID。

  • Team ID:开发者账号右上角的团队 ID(10 字符)。

很赞哦! (0)

文章评论

    高端网站建设