OAuth 2.1 / OpenID Connect provider for traP, providing SSO for traP services.
- Frontend repositories
- Backend repositories
- traPtitech/portal
- traPtitech/portal-oidc (this repository)
Requires mise and Docker.
git clone https://github.com/traPtitech/portal-oidc.git
cd portal-oidc
mise trust # Trust mise configuration
mise run setup # Install pre-commit hooks
mise run dev # Start development environment (Docker + hot-reload)Access:
| Service | URL | Credentials |
|---|---|---|
| OIDC Server | http://localhost:8080 | - |
| Adminer | http://localhost:3001 | root / password |
| OIDC DB | localhost:5433 | root / password |
mise run # Run tasks (with fuzzy search)
mise run gen # Generate code
mise run lint # Run linter
mise run docs # Generate DB schema docsUse these steps only with a disposable development or test database.
-
Apply
db/schema.sqlto the OIDC database. When Docker Compose creates the database, it applies this file. -
Start the server with
OIDC_INTERNAL__TOKENset. Docker Compose sets it fromPORTAL_INTERNAL_TOKENin your shell. -
Send the fixture to the internal provision API:
curl -X POST http://localhost:8080/internal/users/provision \ -H "X-Portal-Internal-Token: <token>" \ -H "Content-Type: application/json" \ --data @development/provision.json
-
Log in as
TestUser_01with the passwordpassword.
The server embeds the built login files in internal/router/v1/loginassets. If you change web/src, rebuild them and commit the output. The build needs Node.js 20.19 or later.
npm --prefix web ci --ignore-scripts
npm --prefix web run build
npm --prefix web test # Check the auth secret test vectorTo run the browser tests, follow these steps:
- Install Chromium with
cd web && npx playwright install chromium. - Start the server on port 8080 with the internal token
browser-test-internal-token. - Run
npm --prefix web run test:browser.
OIDC_TEST_URL and OIDC_TEST_INTERNAL_TOKEN override the URL and the token.
Code licensed under the MIT License.