-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Version 2.2.24 and above breaks Parse.File.save() - unauthorized #3179
Comments
If its cloud based, you need to pass the Javascript key in your config! How are you initializing the server? Pm2? |
@Cliffordwh - As I've said, I'm passing all keys - When I'm testing my Cloud Code Function that contains the Parse.File |
There's your problem. Pass the X-Parse-Application-Id as well. That will resolve it! |
@Cliffordwh - also passing that, and passing |
mmm thats strange. Sorry to ask, but you 100% sure there is no typo when creating the constructor and the keys correspond? Could i ask you to curl without the X-Parse-Session-Token to see if you get a response? |
@Cliffordwh - I'm 100% sure there is not typo. Not including |
@MartinHerman the only last suggestion i can give is to remove I found this comment in a thread.
|
@Cliffordwh - I'm not passing a |
Sorry, i thought you said you where passing all keys. im trying to replicate this with little success. |
Can you run with VERBOSE=1 to gather the server logs and paste them here? |
Also check and make sure you passing serverURL |
You need to do this (add null):
|
@Cliffordwh - as I've already stated, VERBOSE shows nothing. The ServerURL is right as well, as all other calls work. @hedegren - this is the standard format for Parse.Objects - however |
@MartinHerman True, however it seems that you must include the null as first parameter regardless what the docs says. Try it out and see for yourself. |
@hedegren save() on file only take one argument: https://github.com/ParsePlatform/Parse-SDK-JS/blob/master/src/ParseFile.js#L164 |
So for one, I believe we may have introduced an issue there, on the keys checking. Where you do perform you file.save()? I presume in CloudCode. Also, the file.save should work on any client, as you mentioned, this work fine on the iOS SDK. Do you have set |
@flovilmart
However, passing null as the first argument and the {useMasterKey:true} as the second, everything works as expected:
|
We're talking about saving a |
Parse server 2.2.4 with Dashboard 1.0.19 will not save files from the Browser either. Output form chrome console:
Could those be related? Edit: we use all keys in the server config |
@danibjor you mean 2.2.24? update to latest 2.2.25 please. |
@flovilmart - yes, I'm performing it from CloudCode. I'm also setting everything in the constructor, and I'm 100% sure that the values match. See the constructor below. As for the client - I meant that I'm calling native client code from the Parse-iOS-SDK, not sending a request to CloudCode and handling the file there - and that works. @danibjor - if its 2.2.24 or 2.2.25, it seems it could be related, as 403 indicates a permission error. My ParseServer constructor:
|
what is the exact error you get when saving the file? I just ran some test locally (from the node SDK and latest version of parse-server) and I don't seem to be able to reproduce the issue. I however managed to get As you're on CloudCode, you should not need to call Parse.initialize. Is that called by anychance anywhere in your code with a bad applicationId? |
@flovilmart i've spent 3 hours on this issue today with many different setups trying to replicate this issue and i cant. I do get unauthorized but only on the steps ive taken above. @MartinHerman i understand you say there is nothing in the logs, but yet you haven't posted any logs for us to work with. Sometimes it the smallest things that are overlooked. |
@Cliffordwh what steps exactly? Also yes that's normal there's nothing in the log, I don't expect anything special in the logs as the request logger don't apply to the filesRouter (which is an issue in itself) |
@flovilmart im with you! @MartinHerman I might have a theory. Are you able to
|
@flovilmart @Cliffordwh - guys, if you're ever in Slovakia, beers are on me. So it turns out, I was missing the When working on #3051, I've added my Again guys, if you are ever around, beers are on me! |
@MartinHerman i thought so! lol glad you got it working. All the best |
Alight! Closing that! And enjoy the beers for us 🍻 |
@flovilmart tried upgrading the server to 2.2.25 and updated dashboard to latest bits. Console still show 403 on uploading files.
The class has CLP public read/write |
As @MartinHerman, make sure your keys are correctly set. If properly configured, it works correctly. |
Had a similar issue. In your ParseServer constructor, try removing the javascriptKey. |
either remove the |
I also have this issue. I tried with and without the |
@Hitabis - could you post all fields of your Curl request and code from your ParseServer constructor? |
@MartinHerman the constructor is taken from the docker image https://github.com/yongjhih/docker-parse-server/blob/master/index.js
I set I took the example function above:
and the curl request is:
the resonse on 2.2.21 is
the resonse on 2.2.24 is
|
comment out "javascriptKey: process.env.JAVASCRIPT_KEY" |
@FransGH same situation. Can only access with master key. |
You have specified at least one key in your server config. This means you must supply at least one key in any client call. For your curl example you are passing a REST key with the string value undefined. If this does not match the REST key you provided when starting the server then authentication will fail. Session Tokens are not keys. If you want to use request authentication then you must provide a valid key with every request. If you don't want to use request authentication then remove all 4 client keys from your server config. This is not really any less secure and was the default before 2.24 if you didn't specify all keys. |
same issue :( |
Hi everyone,
I think the the recent changes in
v2.2.24
regarding "Better support for checking application and client keys" have broken thesave()
method for saving Parse.Files.This is very likely related to my other issue #3051, which I think has since been resolved in
v2.2.25
.This code worked in
v2.2.23
and below:In
v2.2.24
and above, I'm now gettingunauthorized
, even if I passsave({useMasterKey : true})
. Again, as in #3051, VERBOSE shows nothing.I pass all keys in constructor of ParseServer - as @steven-supersolid suggested in #3051.
Saving from the iOS client app however still works...
The text was updated successfully, but these errors were encountered: