Open-source Identity and Access Management (IAM) engine with native PKCE and multi-tenant isolation.
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.
- 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.
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
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.
Integrating AuthSphere requires the client SDK.
1. Install the SDK
npm install @authspherejs/sdk2. 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");Detailed technical documentation is available in the /docs directory:
| Component | Technologies |
|---|---|
| Frontend | React 19, Vite, Tailwind v4, Zustand |
| Backend | Node.js, Express, MongoDB, Socket.io |
| Security | Argon2id/Bcrypt, RSA-2048, AES-256-GCM |
- Core Authentication Engine
- Admin Dashboard
- TypeScript SDK
- WebAuthn / Passkey Support
- Advanced Webhooks integration
- Multi-region sync capabilities
- 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.