parse-community / parse-server-example

Example of Parse Server using the express framework.

Home Page:http://parseplatform.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Parse queries return unauthorized

emileNetter opened this issue · comments

I'm developping an Android application and I'm using Parse with heroku. My queries were working fine until now. But now none of my queries will work I get the unauthorized error message. On heroku the logs say status 403. I did not change anything in the config files (index.js).
Do you have any idea what could be the problem and how I could debug that ?

Edit : Here is the error message that I get in the Heroku logs :

at=info method=POST path="/parse/login" host=*****.herokuapp.com request_id=05a32631-
08e7-4f26-a685-5006cc51d773 fwd="82.233.**.***" dyno=web.1 connect=0ms service=16ms 
status=403 bytes=466 protocol=https

Here is my config in index.js :

    var api = new ParseServer({
    databaseURI: databaseUri || 'mongodb://localhost:27017/dev',
    cloud: process.env.CLOUD_CODE_MAIN || __dirname + '/cloud/main.js',
    appId: process.env.APP_ID,
    masterKey: process.env.MASTER_KEY, //Add your master key here. Keep it secret!
    serverURL: process.env.SERVER_URL || 'https://***.herokuapp.com/parse',  // Don't forget to 
    change to https if needed

    publicServerURL: 'https://***.herokuapp.com/parse',

I'm using Heroku config vars to declare the MASTER_KEY and the APP_ID and they are the same as in my Parse Initialization.

What is strange is that I can access my parse-dashboard and do some queries and it works with status code 200 like it always did. But from my Android app it's not working anymore...

Thank you for your support !

Okey I spent the day trying to find the error and I finally fixed it. It seems that my dependencies were not up to date, especially the

compile 'com.parse:parse-android:1.14.1'
compile 'com.parse.bolts:bolts-android:1.4.0'

Dunno why it stopped working all of a sudden... Anyway, hope this can help !
Cheers.

I'm having the exact same issue (though it's with a macOS app). Where do you update these dependencies?

I updated these in the build.Gradle file but I don't know if this can apply to your case.

Hmm, is that part of your Android project? Or is that part of the parse server files? Not finding it in my copy of parse-server-example.

It's part of my Android project. But if this is the same error then try to update these dependencies (I'm sure you can find how to update dependencies on Mac). Good luck