0

我创建了一个 iCloud 用户 webuser@somedomain.com 然后我与该用户共享了特定记录。

我想要做的是让一个网站使用该用户仅访问它可以访问的共享记录,但不让他通过 iCloud 与 Apple 进行身份验证。原因是我想在不要求用户登录/注册 Apple iCloud 的情况下控制网站可以做什么以及可以访问什么,并且我不希望每个访问该网站的用户都必须登录 Apple ID . 我虽然使用 web 服务的 cloudkit js 可能有可能,但似乎服务器到服务器的密钥只能访问公共数据库。

我对 JS 不太熟悉,我正试图让 Web 开发人员访问我的记录。

该主题似乎不是很受欢迎,并且那里没有太多信息。请不要只说“不,这不可能”。给我一点信息。

4

1 回答 1

2

You are correct that getting CloudKit data via the server-to-server key or a JS API token can only get you access to the public database. User authentication is required for getting anything in a private or shared database.

This is sensible because your application wouldn't know which private database to query if it didn't have a CloudKit user as a reference. It would also be less secure if an anonymous user (even if it's your application) could query private user data.

As a workaround, you could have the iOS/macOS app push certain parts of the users' data that you want available on the web into your public database. You could make a record type in your public database of something like Web and create fields for all the data that you need. This shared data would then be available, but everything would be available to anyone. The user would still have to identify themselves in your web app to get certain data (which could be done if you had a userId field in your Web record type).

Hopefully that makes sense. Let me know if you have follow-up questions.

于 2018-09-07T21:13:58.970 回答