neo4j / neo4j-example-auth-plugins

Example authentication and authorization plugins for Neo4j
Apache License 2.0
17 stars 12 forks source link

AuthPlugin is not working #3

Closed jakinto closed 7 years ago

jakinto commented 7 years ago

I can't make the MyAuthPlugin work. I'm using a neo4j-community-3.1.2, this is my neo4j.conf:

dbms.security.auth_enabled=true
dbms.security.auth_provider=plugin-org.test.neo4j.plugin.MyAuthPlugin
dbms.security.plugin.authentication_enabled=true
dbms.security.plugin.authorization_enabled=true

And MyAuthPlugin is extending AuthPlugin.Adapter.

No errors when starting Neo4j. Any suggestions?

Thank you.

jexp commented 7 years ago

You don't need it anymore. Neo4j has auth built in since 2.3

Am 09.05.2017 um 16:36 schrieb jakinto notifications@github.com:

I can't make the MyAuthPlugin work. I'm using a neo4j-community-3.1.2, this is my neo4j.conf:

dbms.security.auth_enabled=true dbms.security.auth_provider=plugin-org.test.neo4j.plugin.MyAuthPlugin dbms.security.plugin.authentication_enabled=true dbms.security.plugin.authorization_enabled=true

And MyAuthPlugin is extending AuthPlugin.Adapter.

No errors when starting Neo4j. Any suggestions?

Thank you.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

jakinto commented 7 years ago

I want to implement my own authentication/authorization for a neo4j-community-3.1.2. How can I do that?, is there any example available?

Thanks in advance.

jakinto commented 7 years ago

Is this deprecated?

https://neo4j.com/docs/developer-manual/current/extending-neo4j/auth-plugins/

jexp commented 7 years ago

it's not used anymore at least, we should probably remove it.

Am 10.05.2017 um 10:14 schrieb jakinto notifications@github.com:

Is this deprected?

https://neo4j.com/docs/developer-manual/current/extending-neo4j/auth-plugins/

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

jakinto commented 7 years ago

So, we don't have the possibility to implement a custom authorization, even in the enterprise version?

fickludd commented 7 years ago

Hi jakinto,

I think there is some confusion here. The AuthPlugin API is not deprecated. The reason the MyAuthPlugin example is not working for you is that all security features apart from basic user management are enterprise only. Therefore neo4j-community-3.1.2 is not responding, while neo4j-enterprise-3.1.2 certainly would.

Best, Johan

jakinto commented 7 years ago

Hi!

I tried to deploy a plugin that contains a class implementing org.neo4j.server.security.enterprise.auth.plugin.spi.AuthPlugin in a neo4j-enterprise-3.1.4 and I'm getting:

2017-05-11 06:17:15.664+0000 ERROR Failed to load security module. 2017-05-11 06:17:15.668+0000 ERROR Failed to start Neo4j: Starting Neo4j failed: Component 'org.neo4j.server.database.LifecycleManagingDatabase@74846614' was successfully initialized, but failed to start. Please see attached cause exception. Starting Neo4j failed: Component 'org.neo4j.server.database.LifecycleManagingDatabase@74846614' was successfully initialized, but failed to start. Please see attached cause exception. org.neo4j.server.ServerStartupException: Starting Neo4j failed: Component 'org.neo4j.server.database.LifecycleManagingDatabase@74846614' was successfully initialized, but failed to start. Please see attached cause exception. at org.neo4j.server.exception.ServerStartupErrors.translateToServerStartupError(ServerStartupErrors.java:68) at org.neo4j.server.AbstractNeoServer.start(AbstractNeoServer.java:230) at org.neo4j.server.ServerBootstrapper.start(ServerBootstrapper.java:91) at org.neo4j.server.ServerBootstrapper.start(ServerBootstrapper.java:68) at org.neo4j.server.enterprise.EnterpriseEntryPoint.main(EnterpriseEntryPoint.java:32) Caused by: org.neo4j.kernel.lifecycle.LifecycleException: Component 'org.neo4j.server.database.LifecycleManagingDatabase@74846614' was successfully initialized, but failed to start. Please see attached cause exception. at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:443) at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:107) at org.neo4j.server.AbstractNeoServer.start(AbstractNeoServer.java:202) ... 3 more Caused by: java.lang.RuntimeException: Failed to load security module. at org.neo4j.kernel.impl.factory.EditionModule.setupSecurityModule(EditionModule.java:185) at org.neo4j.kernel.impl.enterprise.EnterpriseEditionModule.setupEnterpriseSecurityModule(EnterpriseEditionModule.java:97) at org.neo4j.kernel.impl.enterprise.EnterpriseEditionModule.setupSecurityModule(EnterpriseEditionModule.java:90) at org.neo4j.kernel.impl.factory.DataSourceModule.(DataSourceModule.java:180) at org.neo4j.kernel.impl.factory.GraphDatabaseFacadeFactory.createDataSource(GraphDatabaseFacadeFactory.java:243) at org.neo4j.kernel.impl.factory.GraphDatabaseFacadeFactory.initFacade(GraphDatabaseFacadeFactory.java:151) at org.neo4j.graphdb.EnterpriseGraphDatabase.(EnterpriseGraphDatabase.java:36) at org.neo4j.server.enterprise.EnterpriseNeoServer.lambda$static$1(EnterpriseNeoServer.java:91) at org.neo4j.server.database.LifecycleManagingDatabase.start(LifecycleManagingDatabase.java:89) at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:433) ... 5 more Caused by: java.lang.IllegalArgumentException: Illegal configuration: Failed to load auth plugin 'plugin-MyAuthPlugin'. at org.neo4j.server.security.enterprise.auth.EnterpriseSecurityModule.illegalConfiguration(EnterpriseSecurityModule.java:316) at org.neo4j.server.security.enterprise.auth.EnterpriseSecurityModule.createPluginRealms(EnterpriseSecurityModule.java:264) at org.neo4j.server.security.enterprise.auth.EnterpriseSecurityModule.newAuthManager(EnterpriseSecurityModule.java:151) at org.neo4j.server.security.enterprise.auth.EnterpriseSecurityModule.setup(EnterpriseSecurityModule.java:94) at org.neo4j.kernel.impl.factory.EditionModule.setupSecurityModule(EditionModule.java:135) ... 14 more

Any ideas?

jakinto commented 7 years ago

The exception is so generic that it gives me no leads. Any help?

fickludd commented 7 years ago

Oh, that is not expected. We are looking into this issue, and will come back soon!

jakinto commented 7 years ago

Thank you very much.

OliviaYtterbrink commented 7 years ago

Your config settings aren't quite correct, it should read:

dbms.security.auth_provider=plugin-org.neo4j.example.auth.plugin.MyAuthPlugin

The error message you got was saying that there was no auth provider plugin with the name specified.