remix-auth-auth0

An Auth0Strategy for Remix Auth, based on the OAuth2Strategy

npm add remix-auth remix-auth-auth0

Introduction

Remix Auth Auth0 is a Remix Auth strategy that signs users in with Auth0. Built on the OAuth2Strategy, it handles the login flow, the tokens and the cookies.

Background

As Remix grew, its apps needed a simple way to sign users in with Auth0. This strategy connects the two, so Auth0 login in a Remix app is a few lines of setup.

Features

Cross-Platform Support

The strategy supports multiple runtime environments:

  • ✅ Node.js
  • ✅ Cloudflare

Flexible Authentication Flow

The strategy provides a comprehensive authentication flow that includes:

  • OAuth2-based authentication
  • Token management
  • Customizable cookie handling
  • Scope-based permissions
  • Token refresh capabilities
  • Token revocation

Customizable Implementation

Developers can customize various aspects of the authentication process:

  • Cookie configuration
  • Scope selection
  • Token handling
  • User data processing

Implementation

Basic Setup

  1. Installation
npm add remix-auth remix-auth-auth0
  1. Strategy Configuration
import { Auth0Strategy } from "remix-auth-auth0";

export let authenticator = new Authenticator<User>();

authenticator.use(
  new Auth0Strategy(
    {
      domain: "xxx.auth0.com",
      clientId: CLIENT_ID,
      clientSecret: CLIENT_SECRET,
      redirectURI: "https://example.app/auth/callback",
      scopes: ["openid", "email"],
    },
    async ({ tokens, request }) => {
      return await getUser(tokens, request);
    },
  ),
);

Advanced Features

Token Refresh

The strategy includes built-in support for token refresh operations:

let tokens = await strategy.refreshToken(user.refreshToken);

Token Revocation

Easily revoke access tokens when needed:

await strategy.revokeToken(user.accessToken);
{
  cookie: {
    name: "auth0",
    maxAge: 60 * 60 * 24 * 7, // 1 week
    path: "/auth",
    httpOnly: true,
    sameSite: "lax",
    secure: process.env.NODE_ENV === "production",
  }
}

Impact

Remix Auth Auth0 has become a crucial tool in the Remix ecosystem:

  • 131 stars and 31 forks on GitHub, as of October 2026
  • Active community contributions
  • Regular updates and maintenance
  • Comprehensive documentation and examples

Technical Details

The project is built with:

  • TypeScript for type safety
  • Comprehensive test coverage
  • MIT licensed for maximum flexibility
  • Regular security updates
  • Community-driven development

Conclusion

Remix Auth Auth0 gives a Remix app Auth0 sign-in in a few lines, and it is still maintained.

Repository: remix-auth-auth0

Since
2021
What
An open source package by Daniel Esteves