Skip to content
 
 

Latest commit

 

History

191 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AuthSphere Logo

AuthSphere

Open-source Identity and Access Management (IAM) engine with native PKCE and multi-tenant isolation.

Version NPM License Uptime

Live DemoSetupDocumentationContributing


Overview

Traditional authentication tightly couples identity code to business logic, requiring your application to handle password hashing, session state, and email generation. This approach increases the attack surface and development overhead.

AuthSphere abstracts identity management into a standalone service. Your application delegates the authentication lifecycle—including OAuth handshakes, OTP generation, and token signing—to AuthSphere, and receives cryptographically verified JWTs.

Features

  • Multi-Tenant Isolation: Cryptographically isolated environments (e.g., Staging vs. Prod) with strict audit logging.
  • Protocol Support: Native OAuth 2.0 and OpenID Connect (OIDC) with enforced PKCE S256.
  • Email Branding: Email template editor with live previews.
  • Live Telemetry: WebSockets stream authentication events and diagnostics directly to the admin dashboard.
  • Identity Management: Granular control over account blocking, verification overrides, and record purging.
  • OAuth Providers: Out-of-the-box support for Google, GitHub, and Discord.

Architecture

AuthSphere is organized as a modular monorepo separated into four core layers:

graph TD
    A[Client Application] -->|Auth Request / PKCE| B(Universal SDK /package)
    B -->|OAuth / API Calls| C(API Engine /backend)
    C -->|Database Operations| D[(MongoDB)]
    E(Admin Dashboard /frontend) -->|Admin API / WebSockets| C
Loading

Setup

Deploy the entire stack via Docker for local testing:

# 1. Clone the repository
git clone https://github.com/madhav9757/AuthSphere.git
cd AuthSphere

# 2. Configure environment variables
cp backend/.env.example backend/.env

# 3. Launch the stack
docker-compose up --build
  • Admin Dashboard: http://localhost:3000
  • API Engine: http://localhost:8000

For manual local development steps, see the Contributing Guide.

Usage

Integrating AuthSphere requires the client SDK.

1. Install the SDK

npm install @authspherejs/sdk

2. Initialize

import AuthSphere from "@authspherejs/sdk";

AuthSphere.initAuth({
  publicKey: "YOUR_PROJECT_PUB_KEY",
  projectId: "YOUR_PROJECT_ID", 
  redirectUri: window.location.origin + "/callback", 
  baseUrl: "https://auth-sphere-6s2v.vercel.app", 
});

3. Trigger Login

AuthSphere.redirectToLogin("google");

Documentation

Detailed technical documentation is available in the /docs directory:

Tech Stack

Component Technologies
Frontend React 19, Vite, Tailwind v4, Zustand
Backend Node.js, Express, MongoDB, Socket.io
Security Argon2id/Bcrypt, RSA-2048, AES-256-GCM

Roadmap

  • Core Authentication Engine
  • Admin Dashboard
  • TypeScript SDK
  • WebAuthn / Passkey Support
  • Advanced Webhooks integration
  • Multi-region sync capabilities

Contributing & Security

  • Contributing: Please see our Contributing Guide for local development setup and guidelines.
  • Security: If you discover a vulnerability, refer to our Security Policy for reporting instructions.

Licensed under the MIT License.

About

Modern OAuth 2.0 authentication platform with PKCE - Secure, scalable auth-as-a-service for developers

Topics

Resources

Contributing

Security policy

Stars

8 stars

Watchers

0 watching

Forks

Packages

Contributors

Languages