我会通过Apple JS在网页上使用“登录Apple”。代码示例可以在以下位置找到:https://developer.apple.com/documentation/signinwithapplejs/configuring_your_webpage_for_sign_in_with_apple
现在的问题是:什么是客户端ID,在哪里可以找到它。我在https://developer.apple.com/account/resources/identifiers/list上测试了应用程序id的标识符,并测试了服务id的标识符。如果我点击按钮并在我的mac上用Touch ID验证,我得到了错误"AUTH_ALERT_SIGN_UP_NOT_COMPLETED":

下面是使用的代码:
<html>
<head>
</head>
<body>
<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 : 'unknown',
scope : 'email',
redirectURI: 'https://mytld/test.php',
state : 'DE'
});
const buttonElement = document.getElementById('sign-in-with-apple-button');
buttonElement.addEventListener('click', () => {
AppleID.auth.signIn();
});
</script>
</body>
</html>我在test.php上没有收到任何请求。
发布于 2019-06-05 02:27:46
客户端ID是启用了“用苹果登录”的Service ID的“标识符”:

苹果公司建议你在Register a Service ID screen上使用以下格式
建议使用反向域名样式字符串(即com.domainname.appname)。它不能包含星号(*)。
https://stackoverflow.com/questions/56442900
复制相似问题