Search code examples
rubydeviseneo4jclearanceneography

Authentication with Neo4j: Is Ruby's Devise or Clearance gems compatible with neography?


I'm new to working with Neo4j and the neography gem. I'm building an API that will require authentication. I'm used to using Devise or Clearance with Postgres to handle authentication. If users are stored as nodes in the Neo4j database, are Devise and/or Clearance compatible with Neo4j? Or will I need to implement my own authentication?


Solution

  • If you're using Neography, you'll need to roll your own authentication. Neography does not have the concept of models that Devise looks for. If you're used to auth gems, devise-neo4j works with Neo4j.rb to provide Devise support.

    Since you're planning on using Neography, Neo4j.rb might be a bit heavier than you're looking for. You could use it for a single User model for auth and then the underlying Neo4j-core gem for basic, more direct Neo4j communication.