git
, openssl
and Docker Compose are needed to run this reference implementation.
Installation steps:
- Install
git
,openssl
and Docker Compose. - Download the git repository to your machine.
- Generate private keys and certificates.
- Build and run applications with Docker Compose.
Download the git repository to your machine and change into its repository:
git clone https://github.com/vrk-kpa/digiid-eservice-integration-reference.git
cd digiid-eservice-integration-reference
- Generate a private key.
openssl genpkey -algorithm RSA -pkeyopt rsa_keygen_bits:4096 -outform PEM -out digiid-ho-public-oidc-tester/client-private-key.pem
- Generate a certificate. Certificate generation command requires the private key generated in the previous step as input.
openssl req -batch -new -x509 -sha256 -days 365 -key digiid-ho-public-oidc-tester/client-private-key.pem -outform PEM -out digiid-ho-public-oidc-tester/client-certificate.pem
Copy the contents of this certificate file into a section fi.dvv.digiid.op.oidcClients.publicKey
(marked with TODO add certificate) in file: digiid-ho-public/digiid-ho-public-op/rest/src/main/resources/application.yml
Make sure to indent the whole certificate to the same level as -----BEGIN CERTIFICATE-----
line.
For example, this section:
fi.dvv.digiid.op:
oidcClients:
- clientId: localhost
redirectUri: http://localhost:3030/auth/callback
publicKey: |
-----BEGIN CERTIFICATE-----
TODO Add certificate
-----END CERTIFICATE-----
should look like this after the certificate has been added (more lines though):
fi.dvv.digiid.op:
oidcClients:
- clientId: localhost
redirectUri: http://localhost:3030/auth/callback
publicKey: |
-----BEGIN CERTIFICATE-----
MIIFazCCA1OgAwIBAgIUFt8Qo2ejogvoNv3lKadJdQfDO4IwDQYJKoZIhvcNAQEL
BQAwRTELMAkGA1UEBhMCQVUxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoM
GEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDAeFw0yMjEwMjEwNTU3NDlaFw0yMzEw
MjEwNTU3NDlaMEUxCzAJBgNVBAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEw
...
...
-----END CERTIFICATE-----
- Generate a signing key.
openssl genpkey -algorithm RSA -pkeyopt rsa_keygen_bits:4096 -outform PEM -out digiid-ho-public/digiid-ho-public-op/rest/src/main/resources/signing-private-key.pem
- Generate a signing certificate.
openssl req -batch -new -x509 -sha256 -days 365 -key digiid-ho-public/digiid-ho-public-op/rest/src/main/resources/signing-private-key.pem -outform PEM -out digiid-ho-public/digiid-ho-public-op/rest/src/main/resources/signing-certificate.pem
Build images and start Docker containers by running Docker Compose.
docker compose up
Note that the Docker containers currently connect to the host
network. The security implications of this are known by DVV's development team. This might be fixed in the future.
For usage instructions see usage instructions.