Zooly Auth

SSO authentication application

Overview

zooly-auth is a self-contained Next.js application that serves as the Single Sign-On (SSO) provider for the entire platform. It handles all authentication and authorization across all apps in the monorepo.

Url: https://auth.zooly.ai

Zooly Auth Screenshot

App Details

  • App Name: zooly-auth
  • Location: apps/zooly-auth
  • Framework: Next.js 15
  • Port: 3003 (development)

Architecture

The auth app is a special project designed to serve as an SSO for the entire application:

  • Cognito Integration: Uses AWS Cognito for SSO authentication
  • DynamoDB: Manages user data using DynamoDB (Cognito data is only used for initial values and roles)
  • Authentication Flows: Supports both redirect+returnTo flow and hidden iframe flow (no redirects)
  • Self-contained: Has its own database and doesn't depend on other apps

Key Features

  • Single Sign-On (SSO) for all apps
  • Cognito-based authentication
  • DynamoDB user data management
  • Multiple authentication flow options
  • Role-based access control

Authentication Flows

The app supports two authentication flows:

  1. Redirect Flow: Traditional redirect with returnTo parameter
  2. Hidden Iframe Flow: No redirects, uses hidden iframe for authentication

Dependencies

  • Next.js 15
  • React 19
  • AWS SDK for Cognito Identity Provider
  • AWS SDK for DynamoDB
  • AWS JWT Verify
  • Tailwind CSS

Scripts

  • dev - Start development server on port 3003
  • build - Build for production
  • start - Start production server
  • lint - Run ESLint

Documentation

For more details on the auth architecture and integration, see: