以chrome扩展名的Apple登录并使用scope = name电子邮件

问题描述

我正在构建具有OAuth登录功能的Chrome扩展程序。为了保持移动应用程序的相同用户群,我正在实施Facebook,Google和Apple登录

使用chrome.identity API,我可以毫无问题地为Facebook和Google实现登录

我现在正在尝试为Apple实现相同的功能。为此,我致电:

const options = { 互动式:真实, 网址:https://appleid.apple.com/auth/authorize?client_id=XXXXXXX&redirect_uri=https%3A%2F%2Fxxxxxxxx.chromiumapp.org&response_mode=form_post&response_type=code%20id_token&scope=name%20email };

chrome.identity.launchWebAuthFlow(options,(returnUrl)=> {});

由于我需要用户电子邮件名称,因此在参数中添加了范围“名称电子邮件”,但这迫使我使用response_mode:'form_post'(在https://developer.apple.com/documentation/sign_in_with_apple/sign_in_with_apple_js/incorporating_sign_in_with_apple_into_other_platforms中进行了说明)。当response_mode设置为form_post时,结果数据不会附加到request_uri,因此登录有效,但是我无法提取所需的信息。删除范围并使用response_mode = query可以正常工作(我能够从redirect_uri中提取id_token),但是我无法提取用户电子邮件和姓名。

是否有解决方法

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)