Skip to content

Parse Cloud always responds "unauthorized" #351

Description

@leonardojobim

I am receiving {"code":141,"error":"Error: undefined unauthorized"} for any Parse Cloud function, even for the simple "hello" function below ( I receive {"error":"unauthorized"}):

My parser-server is hosted in Heroku and using MongoLab.
My cloud/main.js file:

// from https://github.com/ParsePlatform/parse-server/issues/13
var port = process.env.PORT || 1337;
Parse.serverURL = 'https://localhost:' + port + '/parse';

Parse.Cloud.define('hello', function(req, res) {
  res.success('Hi');
});

// Other methods like beforeSave and afterSave ...

Activity

  1. changed the title [-]Parse Cloud always responde "unauthorized"[/-] [+]Parse Cloud always responds "unauthorized"[/+] on Feb 11, 2016
  2. drew-gross commented on Feb 11, 2016

    @drew-gross
    Contributor

    Can you run your server with VERBOSE=1 npm start and paste whatever the server outputs when you make the request?

  3. leonardojobim commented on Feb 11, 2016

    @leonardojobim
    Author

    I suppose that npm start, in this case, is equivalent to node index.js, with no additional script.
    I did it, but there was any log information:

    screen shot 2016-02-10 at 11 13 01 pm

  4. drew-gross commented on Feb 11, 2016

    @drew-gross
    Contributor

    Visiting a path in the browser won't work for two reasons 1) POST is the required HTTP methods for cloud functions and 2) The app ID is required to be submitted with the request. Trying with one of our SDKs should work.

  5. leonardojobim commented on Feb 11, 2016

    @leonardojobim
    Author

    I accessed the '/hello' cloud function from Swift SDK and it worked. I did not know about these details.
    But it was just a bad oversimplification. I related the real problem in a new issue: #356

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:questionSupport or code-level question

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions