Platform-agnostic mock services for Danish government integrations
Test MitID authentication, Serviceplatformen (CPR/CVR/Digital Post), and DAWA address lookups locally without credentials or external dependencies.
Version: 1.0.0 Status: Production Ready Last Updated: February 2026
This repository provides realistic mock services for Danish government integrations, enabling local development and CI/CD testing without requiring actual government credentials or network access.
graph LR
A[Your Application] --> B[Keycloak :8080]
A --> C[WireMock :8081]
A --> D[Prism :8082]
B --> B1[MitID OIDC Mock]
B1 --> B2[10 Test Personas]
C --> C1[Serviceplatformen SOAP]
C1 --> C2[SF1520 CPR Lookup]
C1 --> C3[SF1530 CVR Lookup]
C1 --> C4[SF1601 Digital Post]
D --> D1[DAWA REST API]
D1 --> D2[Address Autocomplete]
style B fill:#326CE5
style C fill:#FF6C37
style D fill:#00D9FF
- Docker and Docker Compose installed
- Ports 8080, 8081, 8082 available (configurable)
# Clone repository
git clone https://github.com/YOUR_USERNAME/danish-gov-mocks.git
cd danish-gov-mocks
# Copy environment file
cp .env.example .env
# Start all services
docker compose up -d
# Or start only specific services
docker compose up -d keycloak wiremock# Check Keycloak is ready
curl http://localhost:8080/health/ready
# Check WireMock is ready
curl http://localhost:8081/__admin/health
# Access admin consoles
# Keycloak: http://localhost:8080/admin (admin/admin)
# WireMock: http://localhost:8081/__adminMock implementation of MitID (Danish national login system) using OpenID Connect.
Features:
- 10 realistic Danish test personas with valid CPR numbers
- Both personal (MitID Privat) and business (MitID Erhverv) users
- CPR, CVR, and birthdate claims in tokens
- Pre-configured OIDC client for immediate use
Endpoints:
- Admin Console:
http://localhost:8080/admin - OIDC Discovery:
http://localhost:8080/realms/danish-gov-test/.well-known/openid-configuration - Authorization:
http://localhost:8080/realms/danish-gov-test/protocol/openid-connect/auth - Token:
http://localhost:8080/realms/danish-gov-test/protocol/openid-connect/token
Test Users: All passwords are test1234
| Username | CPR | Type | Use Case |
|---|---|---|---|
| freja.nielsen | 0804951236 | Personal | Standard citizen |
| lars.andersen | 1505851234 | Personal | Senior citizen |
| mette.jensen | 2003901237 | Business | Business owner |
See docs/test-data.md for complete list.
Mock implementation of Danish Serviceplatformen services.
Services Mocked:
- SF1520: CPR person lookup (10 test persons)
- SF1530: CVR company lookup (5 test companies)
- SF1601: Digital Post (3 scenarios: success, not found, too large)
Endpoints:
- Admin UI:
http://localhost:8081/__admin - SOAP Endpoint:
http://localhost:8081/soap/sf1520(and sf1530, sf1601)
Example Request:
curl -X POST http://localhost:8081/soap/sf1520 \
-H "Content-Type: text/xml" \
-d @examples/sf1520-request.xmlMock implementation of DAWA (Danish Address Web API).
Status: Coming in v1.1 (OpenAPI spec in progress)
Usage:
# Start with Prism enabled
docker compose --profile full up -dChoose your framework:
- Drupal - OpenID Connect and SOAP client setup
- Laravel - Socialite and SOAP configuration
- Node.js - Passport.js and example Express app
- Generic HTTP - Raw curl examples and OIDC flow
services:
keycloak:
image: quay.io/keycloak/keycloak:23.0
env:
KEYCLOAK_ADMIN: admin
KEYCLOAK_ADMIN_PASSWORD: admin
KC_HTTP_ENABLED: true
ports:
- 8080:8080
volumes:
- ./keycloak/realms:/opt/keycloak/data/import
options: >-
--health-cmd "curl -f http://localhost:8080/health/ready"
--health-interval 30sSee ci/github-actions/ for complete templates.
services:
- name: quay.io/keycloak/keycloak:23.0
alias: keycloak
- name: wiremock/wiremock:3.3.1
alias: wiremock
variables:
KEYCLOAK_URL: http://keycloak:8080
WIREMOCK_URL: http://wiremock:8080See ci/gitlab-ci/ for complete templates.
- Architecture Overview - System design and component interactions
- Test Data Reference - Complete persona list with CPR/CVR numbers
- Troubleshooting - Common issues and solutions
- Terminology Glossary - Danish government service terms
All configuration is done via environment variables in .env:
# Change default ports
KEYCLOAK_PORT=9080
WIREMOCK_PORT=9081
PRISM_PORT=9082
# Change admin credentials
KEYCLOAK_ADMIN=myadmin
KEYCLOAK_ADMIN_PASSWORD=securepasswordThe examples/ directory contains ready-to-use integration examples:
examples/drupal/- Drupal settings.php configurationexamples/laravel/- Laravel service providerexamples/nodejs/- Express.js application
This project implements the following standards:
- OpenID Connect 1.0 - MitID authentication mock
- OAuth 2.0 - Token-based authorization
- SOAP 1.1/1.2 - Serviceplatformen web services
- OIO XML Standards - Danish government XML schemas
- OpenAPI 3.0 - DAWA REST API specification
| Term | Danish | Description |
|---|---|---|
| CPR | Personnummer | Civil registration number (social security number) |
| CVR | Virksomhedsnummer | Central Business Register number |
| MitID | MitID | Danish national login system (replaced NemID in 2021) |
| Serviceplatformen | Serviceplatformen | Government service integration platform |
| DAWA | Danmarks Adressers Web API | Danish address database API |
| SF1520 | - | Serviceplatformen CPR lookup service |
| SF1530 | - | Serviceplatformen CVR lookup service |
| SF1601 | - | Serviceplatformen Digital Post service |
| NSIS | Fællesoffentlig Digital Infrastruktur | Danish government digital infrastructure standards |
Contributions are welcome! Please see CONTRIBUTING.md for guidelines.
Apache License 2.0 - See LICENSE for details.
This permissive license allows you to use, modify, and distribute this software for any purpose, including commercial use.
- OS2Adgang - Production-ready Danish IdP/SSO solution
- Keycloak - Open source identity and access management
- WireMock - API mocking framework
- Prism - OpenAPI mock server
- Issues: https://github.com/YOUR_USERNAME/danish-gov-mocks/issues
- Discussions: https://github.com/YOUR_USERNAME/danish-gov-mocks/discussions
Created for the Danish developer community to simplify testing of government service integrations.
Special thanks to the OS2 community for their work on open standards in Danish public sector software.