veliovgroup / ostrio-Neo4jreactivity

Meteor.js Neo4j database reactivity layer
https://atmospherejs.com/ostrio/neo4jreactivity
BSD 3-Clause "New" or "Revised" License
51 stars 5 forks source link

HTTP Basic Auth Connection to Neo4j Server #35

Closed angelcabo closed 9 years ago

angelcabo commented 9 years ago

Is it possible to establish a remote server connection that requires http basic authentication? After poking around the library it looks like the initial connect would have to change from something like this:

var httpRes = HTTP.call('GET', this.url);

to this:

var httpRes = HTTP.call('GET', this.url, {
    auth: this.user + ':' + this.pass
});

At the moment, I get a 401 if I try to do something like NEO4J_URL="http://user:pass@server.com" meteor.

dr-dimitru commented 9 years ago

@AngelCabo please post here your console output. What kind of error it returns to you? Please make sure you've read docs of Neo4jDriver Also try to set connectionURL:

Meteor.neo4j.connectionURL = 'http://user:pass@server.com';
angelcabo commented 9 years ago

with Meteor.neo4j.connectionURL = 'http://user:pass@server.com'; I get a 401 error: screenshot

When I call a custom "makeConnection" server side Meteor method I wrote to use the Http package directly with basic auth, I get a 200:

Meteor.methods({
  'makeConnection': function () {
    var HTTP = Meteor.wrapAsync(Package.http.HTTP.call);
    var httpRes = HTTP('GET', "http://server.com", {
      auth: 'user:pass'
    });
    return httpRes.statusCode;
  },

I probably should have opened the issue on the neo4jdriver project.

dr-dimitru commented 9 years ago

@AngelCabo thank you for issue. Auth exception should be fixed in Neo4jDriver v0.2.12 Please confirm on you end

angelcabo commented 9 years ago

Thanks for the fast fix! Working on my side.

dr-dimitru commented 9 years ago

@AngelCabo thanks for issue and testing on your end