cancel
Showing results for 
Search instead for 
Did you mean: 

Custom trigger: beforeCommit not containing basic transaction info like username on docker

cuenta_chou
Node Link

Dear all,

I am building a plugin that creates a trigger to processes transaction data (created/updated/deleted nodes and relationships) and forwards events into an AMQ.
I am using the latest neo4j version (4.1.3), and I have encountered the following problem:

When the beforeCommit method is called, if I retrieve the username from the TransactionData object passed to the method on my local machine, I am able to get the username under which authorization state this transaction is running. The problem happens when the exact same code is executed on the out-of-the-box docker image. On this scenario, the username returned is always empty.

@Override
public Object beforeCommit( TransactionData data, Transaction transaction, GraphDatabaseService databaseService ) throws Exception
{      logger.info(data.getUsername() }

Any ideas about why this is happening?
Many thanks!
Regards

1 ACCEPTED SOLUTION

anthapu
Graph Fellow

Do you have authentication enabled on the docker instance?

View solution in original post

2 REPLIES 2

anthapu
Graph Fellow

Do you have authentication enabled on the docker instance?

Hi! Thanks for the suggestion.
You were right, it seems I missinterpreted the NEO4J_AUTH parameter. I assumed it was used to stablish a password for the default neo4j user, but it seems that when it's set to none, it also sets
dbms.security.auth.enabled=false
as you can see in the following code line 237:

Many thanks for the support.
Regards.