You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 13, 2026. It is now read-only.
Simplify auth to SSO with optional demo mode (#69)
### Motivation
- Remove the passkey / one‑time login complexity and legacy scripts to
simplify startup and deployments.
- Make it easy for developers to trial the system without passkeys by
exposing an optional demo admin sign‑in.
- Reduce surface area and legacy dependencies related to passkeys/login
links and keep the auth story SSO‑first.
### Description
- Replaced passkey / login‑link flows with an optional demo credentials
provider gated by `ENABLE_DEMO_MODE`, and removed the one‑time login
link code and helper (`src/server/auth/login-link.ts` and related
constants and script).
- Added `ENABLE_DEMO_MODE` to the env schema and wiring (`src/env.ts`,
`.env.example`, `deploy/docker/.env.example`, and
`deploy/docker/docker-compose.yml`) and made UI sign‑in pages honor the
toggle (`src/app/(public-routes)/auth/signin/page.tsx`,
`src/features/shared/auth/sign-in-page.tsx`).
- Simplified user/profile shapes and surfaces to remove passkey
metadata, updated router/service shapes to return core profile fields
only, and trimmed UI that referenced passkey flows
(`src/server/api/routers/users.ts`,
`src/server/services/userService.ts`,
`src/features/settings/components/users-tab.tsx`,
`src/app/(protected-routes)/account/page.tsx`, and
`src/features/shared/users/user-validators.ts`).
- Updated NextAuth config to register a `demo` credentials provider when
enabled, removed passkey experimental enablement and login‑link
provider, and adjusted sign‑in callback logic to enforce provider rules
(`src/server/auth/config.ts`).
- Cleaned up tooling/docs: removed the admin login generation script and
tests targeting login links, removed simplewebauthn package references,
and updated README / docs / AGENTS.md to reflect the SSO‑first + demo
mode approach.
### Testing
- No automated test suites were executed in this rollout;
unit/integration tests were adjusted to the new user/profile shapes but
`npm run test` and `npm run check` were not run here.
- Manual local dependency operations (`npm uninstall`/`npm install`)
were performed to align package.json changes; no test failures were
observed because tests were not executed.
- Recommend running `npm run check` and `npm run test` after pulling
these changes and before merging to validate type/lint/test coverage in
CI.
------
[Codex
Task](https://chatgpt.com/codex/tasks/task_e_6968d0695ea48323a8df1ca927593204)
Copy file name to clipboardExpand all lines: AGENTS.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -72,7 +72,7 @@ Use `eslint-plugin-boundaries` and `no-restricted-imports` to discourage cross
72
72
- Do not duplicate auth checks in child layouts/pages under the group. Rely on the group layout for auth.
73
73
- Keep `src/app/(protected-routes)/settings/layout.tsx` for the admin-only rule; it should only enforce `session.user.role === ADMIN` (assumes auth already passed).
74
74
- Keep public auth at `src/app/(public-routes)/auth/signin/**`.
75
-
-Passkey enrollment happens from the account page after first login via a one-time link.
75
+
-Demo mode login is optional; when enabled it should expose a single button for the initial admin on the sign-in page.
76
76
- The homepage `/` is under the protected group and does not need page-level `auth()`.
Copy file name to clipboardExpand all lines: README.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@ Red Team Assessment Platform (RTAP) is built for internal Red Teams to plan and
16
16
17
17
User Docs:
18
18
-[Installation](docs/installation.md)
19
-
-[Getting Started Workflow](docs/getting-started.md)
19
+
-[Getting Started Workflow](docs/getting-started.md) (look here for UI screenshots)
20
20
21
21
Development Docs:
22
22
-[Development](docs/development.md)
@@ -41,7 +41,7 @@ Initially based on the T3 Stack - Next.js, tRPC, Prisma, TypeScript. Type-safe A
41
41
42
42
Local development runs the Next.js dev server against a local PostgreSQL container. Production workloads also use Docker (web + Postgres) behind your own reverse proxy.
43
43
44
-
Authentication is all passwordless using NextAuth - with an option for passkeys and/or OAuth providers (initial support includes Google SSO).
44
+
Authentication is passwordless and SSO-only using NextAuth. For development and trials you can enable a demo admin sign-in button via `ENABLE_DEMO_MODE=true`.
Copy file name to clipboardExpand all lines: docs/installation.md
+12-19Lines changed: 12 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,8 @@
1
1
# Installation
2
2
3
-
Follow these instructions to set up Red Team Assessment Platform (RTAP) in local development or production environments.
3
+
Follow these instructions to set up Red Team Assessment Platform (RTAP) for production or local testing purposes. This uses pre-built Docker containers.
4
+
5
+
For development environments, you'll probably instead want to run a local npm dev server - not a pre-built container. Additional information is available [here](./development.md).
# If not using SSO, generate 1-time login URL to set up your first passkey
21
-
docker exec rtap-web npm run generate-admin-login
22
+
# Optional: enable demo admin login for trials (see Authentication below)
22
23
```
23
24
24
25
## Authentication
25
26
26
27
### How it Works
27
28
28
-
Let's be the change we want to see in the world. There is no support for passwords! Currently supported options are:
29
-
30
-
- Passkeys (required TLS or localhost)
31
-
- Google OAuth (SSO)
29
+
Authentication is SSO-only, with an optional demo-mode button for trials.
32
30
33
-
The platform uses NextAuth, so adding additional SSO providers would be pretty easy.
31
+
Currently, only Google SSO is enabled. However, [NextAuth supports tons of providers](https://next-auth.js.org/v3/configuration/providers#oauth-providers). Open an issue and I will add providers for you.
34
32
35
33
**Admin bootstrap:**
36
34
37
35
- On first run, the application creates an admin account using `INITIAL_ADMIN_EMAIL` from your `.env`.
38
-
- If using Google SSO, just sign in with the matching Google account.
39
-
- If using passkeys, you must generate a one-time login URL (`npm run generate-admin-login`) and register a passkey for that account.
36
+
- If using SSO, sign in with the matching account and it will just work.
37
+
- If using demo mode, click "Sign in as Demo Admin" (requires `ENABLE_DEMO_MODE=true`).
40
38
41
39
**Ongoing user management:**
42
40
43
41
- Once logged in as admin, you can create additional users.
44
-
- Google SSO users: just log in with the matching Google email.
45
-
- Passkey users: must receive a one-time login URL from the admin, then register a passkey.
46
-
47
-
**Recovery:**
48
-
49
-
- If locked out, re-run `npm run generate-admin-login` to obtain another single-use login URL for the initial admin account.
42
+
- SSO users: log in with the matching email.
50
43
51
44
Accounts must be created inside the platform; SSO logins for unknown emails will be rejected.
52
45
@@ -55,10 +48,10 @@ Accounts must be created inside the platform; SSO logins for unknown emails will
55
48
Authentication options are configured in your `.env` file. The names are slightly different depending on whether you are doing local development or docker compose - the correct values are provided in the appropriate `.env-example` files.
56
49
57
50
```
58
-
# Enable or disable passkey authentication
59
-
AUTH_PASSKEYS_ENABLED=true
51
+
# Demo mode: expose a demo admin login button on the sign-in page
52
+
ENABLE_DEMO_MODE=false
60
53
61
-
# Configuring the follow values will enable Google SSO
54
+
# Configuring the following values will enable Google SSO
0 commit comments