Skip to content

Bug in 2.2.24 - 2.3.2: Cannot connect to Parse Server with Client Key = "" #3486

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
halavins opened this issue Feb 7, 2017 · 5 comments · Fixed by #3497
Closed

Bug in 2.2.24 - 2.3.2: Cannot connect to Parse Server with Client Key = "" #3486

halavins opened this issue Feb 7, 2017 · 5 comments · Fixed by #3497

Comments

@halavins
Copy link

halavins commented Feb 7, 2017

Dear Sirs,

I've updated my Parse Server and found out that all Parse Server versions starting with 2.2.24 do not allow me to connect to it if I use "PARSE_SERVER_CLIENT_KEY": "". The problem is that all our released apps use the blank key to connect to Parse Server, so we can't change it to any other value.

I see there was a "bug fix" called:
Better support for checking application and client keys, thanks to Steven Shipton

This is the one which actually causes the issue. We tried downgrading the Parse Server to 2.2.23. And everything works ok now. If we upgrade it to 2.2.24 back, we can't connect to the server anymore with ClientKey = "". If we change the ClientKey to anything but "", it works. Nevertheless, we cannot change the client key to anything but "", because most of our clients have already downloaded the apps with ClientKey = "".

  • Server

    • parse-server version 2.2.24 - 2.3.2
    • Operating System: Ubuntu
    • Hardware: 8 CPU, 8 GB RAM, 150GB Disk Space
    • Localhost or remote server? Rackspace
  • Database

    • MongoDB version: 3.2.8
    • Storage engine: WiredTiger
    • Hardware: 250GB
    • Localhost or remote server? ObjectRocket

LOGS of the XCode, when trying to connect to Parse Server 2.2.24 with ClientKey = "" (the same key is in the parse server config ecosystem.json):
{ error : unauthorized }.

@halavins halavins changed the title Bug in 2.2.24 and above: Cannot connect to Parse Server with Client Key = "" Bug in 2.2.24 - 2.3.2: Cannot connect to Parse Server with Client Key = "" Feb 7, 2017
@acinader
Copy link
Contributor

acinader commented Feb 9, 2017

so i think that this is the commit: e788d49

@halavins
Copy link
Author

halavins commented Jun 16, 2017

Doesn't look like the issue is fixed.

Look. Here is my connection string in swift:

ParseMutableClientConfiguration.applicationId = "[hidden_app_id]"; ParseMutableClientConfiguration.clientKey = ""; // ParseMutableClientConfiguration.server = "[hidden_url]";

And here is my code on the server:
... "PARSE_SERVER_APPLICATION_ID": "[hidden]", "PARSE_SERVER_MASTER_KEY": "[hidden]", "PARSE_SERVER_COLLECTION_PREFIX": "", "PARSE_SERVER_CLIENT_KEY": "", "PARSE_SERVER_REST_API_KEY": "[hidden]", ...

Upgraded to latest Parse Server. Still getting { error : unauthorized }

Had to downgrade back to 2.2.23.

Is it possible to resolve the issue so that I could upgrade my Parse Server to 2.4.2?

@steven-supersolid
Copy link
Contributor

steven-supersolid commented Jun 16, 2017

It looks like the empty string is being ignored because "" is falsey so I can put in a fix for that unless someone beats me to it :)
As a workaround you could remove all your client keys from your server config (or set all to empty string).

EDIT: Just saw @acinader's fix and it should work, so not sure what is happening there

@halavins
Copy link
Author

@steven-supersolid I tried removing client Key from the server. It didn't help.

Please take into account that I can change anything on servers, but I can't change the connection string and client key for the app. We have too many clients to lose. We cannot force everyone to update the connection string again. When we migrated off Parse we lost 50k MAU just because of that.

@steven-supersolid
Copy link
Contributor

To clarify for the workaround, when I say remove all your client keys I mean remove all 4, including the REST API Key, leaving only the master key. This will make the server run in key-less mode.

An empty string key should work though and there are passing tests in #3497 for this so I suspect that your server initialisation is not passing the empty string to the Parse constructor. How do you initialise Parse?

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

Successfully merging a pull request may close this issue.

3 participants