Skip to content

Unauthorized error when trying to access parse custom hosted server #219

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
marcgug opened this issue Feb 3, 2016 · 4 comments
Closed

Comments

@marcgug
Copy link

marcgug commented Feb 3, 2016

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?

@marcgug marcgug changed the title Unauthorized error when trying to access parse server Unauthorized error when trying to access parse custom hosted server Feb 3, 2016
@marcgug
Copy link
Author

marcgug commented Feb 3, 2016

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).

@ghost
Copy link

ghost commented Feb 3, 2016

What to modify in parseclient.php

@marcgug
Copy link
Author

marcgug commented Feb 3, 2016

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.

@gfosco
Copy link
Contributor

gfosco commented Feb 17, 2016

Updated in 1.2.0, see #222

@gfosco gfosco closed this as completed Feb 17, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants