1
votes

I'm building an app using MarkLogic’s Node.js Client API using LDAP as the external security for authentication, though it’s using the internal security database for authorization.

For every write/read/query to MarkLogic, the Node.js API needs to call the createDatabaseClient method. However, this method requires a username and password.

We don’t store the user’s password locally and we definitely don’t want to require the user to enter their password for every operation.

Is there some way to call createDatabaseClient as a different user?

For example, could I authenticate as an Admin user and then provide the username of the user I'd like to search as and have MarkLogic return results as if I were that user.

1
@grtjn any input? I see you've answered a lot of tough MarkLogic questions on here. - TravisChambers

1 Answers

2
votes

The Node.js middle-tier client can create the database client once for a user and use the same database client for any number of subsequent requests.

Is the middle-tier client maintaining some kind of session state for the authenticated user? If so, could it cache the database client as part of the user state?