Howdy,
Using node.js and .ejs
What is the best way to pass neo4j.driver auth info from server to client? I'm assuming this can be done?
Here's what I have...
server.js
const driver = neo4j.driver('bolt://localhost:7687', neo4j.auth.basic('abc','123'));
const session = driver.session();
Then on the client side I have the following. At this point I am 'hard-coding' the username and password into the AUTHORIZATION, but I'm hoping there's a way to pull this info from the server using the const driver or const session?
index.ejs
var AUTHORIZATION = "Basic " + btoa("abc:123"); //are there variables from the server I can put here?
...
//Then there is another section requesting AUTHORIZATION
function displayGraph() {
// Create the authorization header for the ajax request.
AUTHORIZATION = "Basic " + btoa("abc"+":"+"123"); //again hoping to use variables from server side
...
It's likely worth noting that this involves an AJAX call that uses the AUTHORIZATION var that is used to render a vis.js graph using Neo4j data, and all of this vis.js auth code is currently setup on the client side.