From 91ae2e57e2ec5b5e277266a0cc705dfa24f891b2 Mon Sep 17 00:00:00 2001
From: Shekar V
Date: Tue, 9 Jun 2026 21:53:14 -0400
Subject: [PATCH 01/19] Added Entra OIDC
---
app/(auth)/login/page.tsx | 25 ++++-
app/api/auth/entra/callback/route.ts | 59 ++++++++++
app/api/auth/entra/login/route.ts | 42 +++++++
app/api/auth/entra/logout/route.ts | 45 ++++++++
app/api/auth/entra/refresh/route.ts | 64 +++++++++++
app/api/auth/session/route.ts | 31 ++++++
app/api/tiled/[...path]/route.ts | 21 +++-
app/api/ws/[...path]/route.ts | 49 ++++++--
components/layout/header.tsx | 5 +-
components/providers/auth-provider.tsx | 123 +++++++++++++++-----
lib/auth/config.ts | 114 +++++++++++++++++++
lib/auth/cookies.ts | 92 +++++++++++++++
lib/auth/entra.ts | 148 +++++++++++++++++++++++++
lib/auth/jwt.ts | 86 ++++++++++++++
lib/auth/obo.ts | 112 +++++++++++++++++++
lib/auth/oidc-flow.ts | 144 ++++++++++++++++++++++++
lib/auth/token-store.ts | 81 ++++++++++++++
lib/tiled/auth.ts | 25 ++++-
lib/tiled/client.ts | 52 +++++++--
lib/tiled/types.ts | 10 ++
lib/tiled/websocket.ts | 3 +-
package-lock.json | 8 +-
package.json | 1 +
23 files changed, 1286 insertions(+), 54 deletions(-)
create mode 100644 app/api/auth/entra/callback/route.ts
create mode 100644 app/api/auth/entra/login/route.ts
create mode 100644 app/api/auth/entra/logout/route.ts
create mode 100644 app/api/auth/entra/refresh/route.ts
create mode 100644 app/api/auth/session/route.ts
create mode 100644 lib/auth/config.ts
create mode 100644 lib/auth/cookies.ts
create mode 100644 lib/auth/entra.ts
create mode 100644 lib/auth/jwt.ts
create mode 100644 lib/auth/obo.ts
create mode 100644 lib/auth/oidc-flow.ts
create mode 100644 lib/auth/token-store.ts
diff --git a/app/(auth)/login/page.tsx b/app/(auth)/login/page.tsx
index 6e04b58..729536d 100644
--- a/app/(auth)/login/page.tsx
+++ b/app/(auth)/login/page.tsx
@@ -12,7 +12,7 @@ type AuthMode = 'password' | 'apikey';
export default function LoginPage() {
const router = useRouter();
- const { login, loginWithApiKey, isLoading } = useAuth();
+ const { login, loginWithApiKey, loginWithEntra, isLoading } = useAuth();
const [mode, setMode] = useState('password');
const [username, setUsername] = useState('');
const [password, setPassword] = useState('');
@@ -79,6 +79,29 @@ export default function LoginPage() {
+ {/* Microsoft SSO */}
+
+
+ {/* Divider */}
+
+
{/* Mode Toggle */}