Start a new topic

Accesing REST API from a server without a user?


I'm developing a web application where people can create custom pages. Since kinvey does not gives us a webhosting facility (right?) i'm hosting a seperate server which acts as a webserver and shows the custom pages. Now I need to access the data from my own server to construct the html of these pages. But as every api request requires an authorization from a user, i don't see how i can do this? So basically i need to access the REST API from my server which can read all the data of a specific page of a user.

1) Is this possible somehow?

2) If so how can i achieve this?

Please help.

Thanks in advance.


You can do this with the Master Secret for your app. OR you can authenticate with Basic Authentication using an Admin user you create in the system.

Here's an example of fake account details you'd use to query some collection called 'Tests':

* App Key : kid_3kdk39di_K

* Collection Name : Tests

* Master Secret : qweokasle389aslasd0

* Master Secret Base64 Encoded : cXdlb2thc2xlMzg5YXNsYXNkMA==

* curl Command : curl -X GET -H Authorization:Basic cXdlb2thc2xlMzg5YXNsYXNkMA=="

The example above uses curl. However, you could adapt it for any backend language such as PHP, Node, ASP, etc.

Be sure to never expose your Master Secret in forums here. So, if you need further help, obfuscate it before posting.
Wow, perfect. Didn't thought of doing that. Although i think it is better to create some sort of admin account instead of the master as i only need to read. Thanks!
Login or Signup to post a comment