Unauthorized error when trying to access parse custom hosted server
Hi,
Since Parse is shutting down, I am trying to follow the migration guide to setup my own parse server. I have the server setup and working (because I can access the data via CURL requests), however, it seems like the php-sdk is not working correctly because I always get the following error:
Fatal error: Uncaught exception 'Parse\ParseException' with message 'unauthorized' in /home2/marc/public_html/oyster_admin/vendor/parse/php-sdk/src/Parse/ParseClient.php:346
Does this possibly have to do with the fact that only the AppID is required for parse server instances and the php-sdk initialization requires the AppID, RestKey, and MasterKey?
This is because the php-sdk assumes that the parse server always lives at api.parse.com. There is currently no way to override that (except for modifying it manually in ParseClient.php).
What to modify in parseclient.php
HOST_NAME on line 19 needs to be changed from api.parse.com to the url of your custom server.
You also need to remove the references to the /API_VERSION on lines 470 and 302.
There really should be an update made to this repo to support specifying a custom hostName in the initialization function. If I have time, I will open a PR for that.
Updated in 1.2.0, see #222