-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
'invalid key name: _ApplicationId' error on signup #246
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
Comments
It's a pretty common technique in JavaScript projects because ajax requests can't use all of the HTTP methods, so everything goes through POST with a method override. See |
Attaching the tcpdump output (with -A option) for the request + response. |
If the incoming request has app id specified both in the header AND the JSON body, then check that both are the same. Flag the request as invalid if they are not the same. If the app id is not specified in the headers, then pick it up from the JSON body. Signed-off-by: Kunal Gangakhedkar <[email protected]>
See if commit kunalg/parse-server@6d99a1f helps. I've verified that it works with my setup of Parse JS SDK. I've been trying to proxy the different standalone node instances running parse-server for different app configs (for multi-tenancy) using HAproxy. That script is not able to modify the body - to remove these fields from incoming JSON :( If the above commit works for you, let me know - I'll send a PR. |
Looks like you're posting with a content-type of text/plain instead of application/json. Can you update your content-type header on post? |
It's the JS sdk that's posting it - I've not changed anything in the sdk. |
I see, it is a byproduct of your HAProxy rewriting.... Go ahead and submit a PR to coalesce the application id (but also cover the client keys too) and remove them from the body if they've been set in the headers. 👍 |
If the incoming request has app id specified both in the header AND the JSON body, then check that both are the same. Flag the request as invalid if they are not the same. If the app id is not specified in the headers, then pick it up from the JSON body. Moreover, remove the app config keys (app id, master key, js key, .net key etc.) from the request body unconditionally - ie. even if those are specified in the header. This is so that if the proxy fronting the app is not able these keys from the body. Signed-off-by: Kunal Gangakhedkar <[email protected]>
If the incoming request has app id specified both in the header AND the JSON body, then check that both are the same. Flag the request as invalid if they are not the same. If the app id is not specified in the headers, then pick it up from the JSON body. Moreover, remove the app config keys (app id, master key, js key, .net key etc.) from the request body unconditionally - ie. even if those are specified in the header. This is so that if the proxy fronting the app is not able these keys from the body. Signed-off-by: Kunal Gangakhedkar <[email protected]>
@kunalg did you submit a PR for this? I think I am having the same issue. |
Updated the parse-server to latest (v2.0.6).
Dropped the DB and created new blank db in Mongo.
From node cli, tried to sign up a new user as described here.
So far, I've been using this same setup successfully till v2.0.4 of parse-server.
Creating the user object using REST API with curl works properly. Then, the same Node.js cli process is able to login the user successfully.
login from node cli:
Funnily, the JS sdk does not send the app id and the keys in the HTTP headers (X-Parse-Application-Id, X-Parse-Javascript-Key, X-Parse-Master-Key etc.) like other SDKs - instead, it sends it as part of HTTP body (JSON).
I verified that at least android and .NET/Unity SDKs send the app id and keys via HTTP headers by going through the code on github.
I've not been able to understand the reason for it. Can anyone please explain why the JS sdk behaves differently?
The text was updated successfully, but these errors were encountered: