我会通过 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 的请求。