Authentication system: Build or buy

Authentication system: Build or buy

I've noticed a peculiar pattern across multiple organizations: teams frequently end up building authentication systems from scratch. While this approach has its merits, I believe it's time to reconsider this common practice.

The Hidden Costs of Building Authentication

Building an authentication system consumes significant senior engineering time. The challenges include:

  • Implementing multiple social login providers (Google, Facebook, etc.)
  • Ensuring security best practices
  • Maintaining and updating the system
  • Creating a seamless user experience

For most businesses, authentication isn't a core differentiator or value proposition. Yet, it often demands disproportionate engineering resources that could be better allocated to building unique features that directly benefit your business.

The Case for Pre-built Solutions

We've seen similar shifts in thinking before, particularly in the migration from hosted to cloud infrastructure. Today, many teams I work with are increasingly adopting Backend-as-a-Service (BaaS) solutions, especially when rapid development is crucial.

When to Consider Pre-built Authentication:

  1. Your authentication needs are standard
  2. Time-to-market is a priority
  3. You want to focus engineering resources on core business features
  4. You need robust security without reinventing the wheel

When to Build Custom:

  1. Your system has unique requirements
  2. You have a dedicated team with authentication expertise
  3. You need complete control over the authentication flow
  4. Cost at scale is a major concern (BaaS solutions can get expensive quickly)

Real-world Challenges: A Case Study

Recently, we implemented Clerk for authentication in a web application. While it worked seamlessly for our web platform, we encountered significant challenges when expanding to Android:

  • Lack of native Android SDK support
  • Need to work directly with backend APIs
  • Complex customization requirements
  • Compromised native user experience

Our short-term solution involved implementing WebView, but this came with its own set of trade-offs in terms of user experience.

Key Takeaways

  1. Consider your long-term platform strategy before choosing an authentication solution
  2. Evaluate the true cost of building vs buying, including maintenance
  3. Factor in future scalability and platform expansion
  4. Remember that authentication, while critical, is rarely a core business differentiator

Some Options

BaaS providers

  1. Firebase Authentication Firebase, owned by Google, offers a comprehensive authentication system supporting various sign-in methods including email/password, phone numbers, and popular federated identity providers
  2. AWS Cognito Part of AWS Amplify, Cognito provides user sign-up, sign-in, and access control for web and mobile apps
  3. Auth0 A flexible, drop-in solution for adding authentication and authorization services to applications
  4. Okta Offers a robust identity management platform with support for multi-factor authentication and social login
  5. Clerk (what we used) While primarily focused on web applications, Clerk provides authentication services that can be integrated into mobile apps with additional work!

Open-Source Authentication Solutions

  1. Keycloak An open-source identity and access management solution that can be self-hosted
  2. Supabase Auth Part of the Supabase open-source Firebase alternative, it provides authentication services that can be self-hosted or used as a service
  3. Appwrite An open-source backend server that includes authentication features and can be self-hosted
  4. NHOST An open-source Firebase alternative that includes authentication services
  5. Ory A cloud native identity and access management platform that's open-source and can be self-hosted
  6. Passport.js While primarily for web applications, it's a popular open-source authentication middleware for Node.js that can be adapted for use with mobile backends


For startups particularly, I recommend seriously considering pre-built authentication solutions. The time and resources saved can be invaluable for focusing on your core product. However, ensure you thoroughly evaluate your specific needs and growth plans before making this decision.

要查看或添加评论,请登录

Jacob Chencha的更多文章

  • Tackling Data Integrity in Financial Systems

    Tackling Data Integrity in Financial Systems

    As an Engineering Manager in the fintech space, I've learned that the most challenging problems aren't always about…

    2 条评论
  • Transforming Revenue Recognition Through Machine Learning

    Transforming Revenue Recognition Through Machine Learning

    During my time at Meta, I led engineering team in charge of revenue recognition. The Revenue organization handled…

  • Tips on process of writing design document

    Tips on process of writing design document

    As a senior team member or technical manager, creating design documents helps you in achieving organizational…

  • Kubernetes at the edge

    Kubernetes at the edge

    On 10th October 24, I had the opportunity to attend day two of the #GoogleCloud Summit, where I was particularly drawn…

  • When Legacy Systems Fight Back

    When Legacy Systems Fight Back

    I had an opportunity to attend the #GoogleCloud on 9th October 2024. One talk that really intrigued me was by Paul…

  • What is Kubernetes control plane?

    What is Kubernetes control plane?

    The control plane in Kubernetes is like the brain of the system. It manages and controls everything that happens in…

  • How to convince senior stakeholders to adopt new technology

    How to convince senior stakeholders to adopt new technology

    Convincing a senior stakeholder to embrace new technology, especially when resistant, can be challenging. I've…

    1 条评论
  • Software Engineer? Domain Expertise Is Your Differentiator

    Software Engineer? Domain Expertise Is Your Differentiator

    Introduction I have been giving some thoughts to why domain knowledge is important in building a career in fintech. I…

  • Lets talk event driven architecture

    Lets talk event driven architecture

    I’m a big fan of event-driven architecture. I think it’s a great way to build scalable and resilient systems.

    2 条评论
  • Growth mindset: a personal perspective

    Growth mindset: a personal perspective

    What does having a growth mindset mean to me? Let me share an experience from my younger days that shaped my…

    1 条评论