-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
{"message":"unauthorized"}
when using JS SDK with Parse-Server
#1539
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
You can enable logging using |
I've done that and nothing changes. No new logs, just {"message":"unauthorized"} returned from the error function of the above query. Thanks for the quick response! |
In that case the error is probably not in Parse Server. Check your SDK initialization to make sure you the right server URL and keys. |
I'm not using a JS key. Is this a good init? |
As long as that URL, app ID, and master key are all actually correct, then yes that seems fine. |
The error is coming from middlewares.js. The At line 57 |
That shouldn't be the case. Can you post the JS SDK version you are using and the Parse Server version? |
Have you try setup jskey on parse-server and init it in jssdk? |
I'm using "parse-server": "^2.2.7" with "parse": "^1.8.3". I tried it with the jskey and still the same. |
Looks like the only way I can access is through the REST api. The Parse-Dashboard is unauthorized as well. |
Those should work. How did you find out where the error is if you can't see any logs? |
I stepped through with the debugger ... Well, the problem has been found. The 'body-parser' middleware I was using seems to have been mangling the requests. The jssdk and parse-dashboard are working. I appreciate your time. |
Environment Setup
My issue is very similar to this one.
I'm using "parse-server": "^2.2.7" with "parse": "^1.8.3".
I forked the Parse-Server-Example and everything works fine locally and on Heroku with the Rest API. As soon as I try to use the javascript sdk I get
{"message":"unauthorized"}
.I've tried with and without a javascriptKey, with or without initializing parse, with and without useMasterKey = true.
Steps to reproduce
This curl works:
curl -X GET \ -H "X-Parse-Application-Id: myAppId" \ -H "Content-Type: application/json" \ http://localhost:1337/parse/classes/_User
But this query gets
{"message":"unauthorized"}
:Logs/Trace
No logs to trace. I'm really at a loss, I posted on SO 2 days and no comments or answers. So I'm posting here. Thanks!
The text was updated successfully, but these errors were encountered: