Skip to content

Parse-SDK-JS on Node.js basic authentication error #366

@Simone-cogno

Description

@Simone-cogno

I using Parse-SDK-JS on node and i get the following error when trying to query the database.
Here the code:

var Parse = require('parse/node').Parse;
Parse.initialize(cnf.parseServer.appId);
Parse.serverURL = 'http://xxx/parse';

//Then I tried to query the database
app.get('/', function (req, res) {
    var query = new Parse.Query(Parse.User);
    query.find().then(users => {
        console.log(users.length);
        res.send('Hello World!');
    }, err => {
        console.log(err);
        res.send('Error World!');
    });
});

But i get this error:


ParseError {
  code: 107,
  message: 'Received an error with invalid JSON from Parse: <html>\r\n<head><title>403 Forbidden</title></head>\r\n<body bgcolor="white">\r\n<center><h1>403 Forbidden</h1></center>\r\n<hr><center>nginx</center>\r\n</body>\r\n</html>\r\n' }

Note that my server need a Basic authentication to connect.

When calling the REST API from the client it works just fine (proably because the basic authentication are saved into the browser cookies).

So my question is: there is a way to set the Basic authentication the parse library?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions