How can I control access to content in ICP?

How can I control access to content in ICP?
I want to make sure that only users who meet certain criteria can view premium content.

2 Likes

If you make calls after the user logged in then you can check if their principal meets the criteria. This won’t work for HTTP requests as those always happen anonymously, but for anything else this should be pretty straightforward. The keyword you want to search for is caller.

It doesn’t seem to be what I expect.
I want to upload some content and only allow certain users to view it.
I don’t want the node holding the data to be able to see the content either.

In that case, you need to encrypt the data before uploading. Additionally, you need a mechanism to share the decryption key with the users that are authorized to view the content.

It looks like the functionality I want can be achieved with vetkeys. I hope vetkeys will be implemented as soon as possible.

1 Like