Need advice about which tool to choose?Ask the StackShare community!

Devise

414
231
+ 1
56
Passport

332
366
+ 1
0
Add tool

Devise vs Passport: What are the differences?

Key Differences between Devise and Passport

Introduction Devise and Passport are two popular authentication libraries used in web development. While both serve the purpose of user authentication, there are key differences that set them apart from each other.

  1. Implementation Language: Devise is primarily designed for Ruby on Rails applications, while Passport is commonly used with Node.js. This means that Devise integrates seamlessly with Ruby on Rails features and conventions, such as ActiveRecord for managing database records. Passport, on the other hand, leverages the asynchronous and event-driven nature of Node.js, making it a good fit for JavaScript-based applications.

  2. Community and Ecosystem: Devise has a long-standing community and a large number of contributors, making it a mature and well-documented library. It has a wide range of plugins and extensions available, providing additional functionality and customization options. Passport, although not as mature as Devise, has a growing community and a modular design that allows developers to easily integrate various authentication strategies.

  3. Authentication Strategies: Devise mainly focuses on username/password authentication, providing features like session management, password encryption, and email confirmation. Passport, on the other hand, is a library that handles authentication through multiple strategies, including local username/password, social login (such as Google, Facebook, etc.), and token-based authentication using JSON Web Tokens (JWT). This flexibility makes Passport more suitable for applications that require different authentication methods.

  4. Middleware vs Engine: Devise is implemented as a Rails engine, which means it provides a set of predefined routes, views, and controllers that can be easily customized. Passport, on the other hand, is a middleware that can be used with any Node.js framework. It does not provide any UI components or pre-defined routes, giving developers more flexibility to design their own authentication flow.

  5. Database and ORM: Devise is tightly integrated with ActiveRecord, the default ORM for Ruby on Rails. It provides built-in database models and migrations for user-related functionality. Passport, being framework-agnostic, does not make any assumptions about the database or ORM being used. It allows developers to choose their preferred database and ORM, such as Sequelize or MongoDB, providing more flexibility in terms of database choices.

  6. Learning Curve: Devise follows the conventions of Ruby on Rails and provides an intuitive and easy-to-use interface for implementing authentication. If you are already familiar with Ruby on Rails, it is relatively straightforward to get started with Devise. Passport, being a JavaScript library, requires knowledge of JavaScript and Node.js concepts. It may have a steeper learning curve for developers who are new to JavaScript or Node.js.

In summary, Devise and Passport differ in their implementation language, community support, authentication strategies, implementation style, database compatibility, and learning curve. Both have their strengths and weaknesses, and the choice between them depends on the specific requirements of your project and your familiarity with the respective technologies.

Advice on Devise and Passport
Needs advice
on
Auth0Auth0
and
PassportPassport

Currently, Passport.js repo has 324 open issues, and Jared (the original author) seems to be the one doing most of the work. Also, given that the documentation is not proper. Is it worth using Passport.js?

As of now, StackShare shows it has 29 companies using it. How do you implement auth in your project or your company? Are there any good alternatives to Passport.js? Should I implement auth from scratch?

See more
Replies (1)
Recommends
on
Auth0Auth0

I would recommend Auth0 only if you are willing to shell out money. You can keep up with their free version only for a very limited time and as per our experience as a growing startup where budget is an issue, their support was not very helpful as they first asked us to sign a commercial agreement even before helping us t o find out whether Auth0 fits our use case or not! But otherwise Auth0 is a great platform to speed up authentication. In our case we had to move to alternatives like Casbin for multi-tenant authorization!

See more
Get Advice from developers at your company using StackShare Enterprise. Sign up for StackShare Enterprise.
Learn More
Pros of Devise
Pros of Passport
  • 33
    Reliable
  • 17
    Open Source
  • 4
    Support for neo4j database
  • 2
    Secure
    Be the first to leave a pro

    Sign up to add or upvote prosMake informed product decisions

    - No public GitHub repository available -

    What is Devise?

    Devise is a flexible authentication solution for Rails based on Warden

    What is Passport?

    It is authentication middleware for Node.js. Extremely flexible and modular, It can be unobtrusively dropped in to any Express-based web application. A comprehensive set of strategies support authentication using a username and password, Facebook, Twitter, and more.

    Need advice about which tool to choose?Ask the StackShare community!

    What companies use Devise?
    What companies use Passport?
    See which teams inside your own company are using Devise or Passport.
    Sign up for StackShare EnterpriseLearn More

    Sign up to get full access to all the companiesMake informed product decisions

    What tools integrate with Devise?
    What tools integrate with Passport?

    Blog Posts

    Sep 29 2020 at 7:36PM

    WorkOS

    PythonSlackG Suite+17
    6
    3047
    What are some alternatives to Devise and Passport?
    Active Admin
    Active Admin is a Ruby on Rails framework for creating elegant backends for website administration.
    OmniAuth
    OmniAuth is a Ruby authentication framework aimed to abstract away the difficulties of working with various types of authentication providers. It is meant to be hooked up to just about any system, from social networks to enterprise systems to simple username and password authentication.
    Auth0
    A set of unified APIs and tools that instantly enables Single Sign On and user management to all your applications.
    JSON Web Token
    JSON Web Token is an open standard that defines a compact and self-contained way for securely transmitting information between parties as a JSON object. This information can be verified and trusted because it is digitally signed.
    Keycloak
    It is an Open Source Identity and Access Management For Modern Applications and Services. It adds authentication to applications and secure services with minimum fuss. No need to deal with storing users or authenticating users. It's all available out of the box.
    See all alternatives