This is a Next.js app which sets up a OAuth 2.0 and OpenID Connect Provider using Ory Hydra as a backend. It has an unstyled UI and doesn't implement user management but can be easily modified to fit into your existing system.
- User login, logout, registration, consent
- CSRF protection with edge-csrf
- Super-strict HTTP security headers (configurable)
- Client-side JavaScript disabled by default
- Unit tests with Jest
- E2E tests with Cypress
- Start/stop Hydra in development using docker-compose
- Easily customizable
- Written in TypeScript
This application can be configured using the following environment variables:
| Name | Default |
|---|---|
| SECURITY_HEADERS_ENABLE | false |
| HYDRA_ADMIN_URL | http://localhost:4445/ |
To install dependencies:
yarn installTo run the Next.js app server in development mode:
yarn devTo start/stop hydra in development you can use the docker-compose file found in the ory/ directory:
# start
docker compose -f ory/docker-compose.yml up -d
# stop
docker compose -f ory/docker-compose.yml down
# stop and remove mounted volumes
docker compose -f ory/docker-compose.yml down -v
docker compose -f ory/docker-compose.yml rm -fsvTo run the app in production first run the build command then run start:
yarn build
yarn startTo run the unit tests (using Jest):
yarn testTo run the E2E tests (using Cypress):
yarn build
yarn test-e2e