This guide provides step-by-step instructions for setting up the Wallet Lab services, covering the configuration of hostnames, ports, and certificates. It also explains the role of each service and how they interact within the system.
The services consist of multiple components, each serving a specific role in credential issuance and verification. This section describes the components, their roles, and functionality. The services are deployed using Docker Compose and interact with each other over defined ports and networks.
Understanding network layers is essential to configure the infrastructure correctly:
MockAS
, MongoDB
, APIgw
Jaeger
, UI
SATOSA
, SimpleSAMLphp
Each service in the VC-service infrastructure operates on a specific port, which determines how it communicates within the system. The port assignments define whether a service is accessible externally (from the internet), locally (within the host machine), or internally (within the Docker network only).
The following table provides an overview of the ports and their respective connectivity requirements:
Service | Port | Connectivity Type | Notes |
---|---|---|---|
SATOSA | 8000 | External | Issues credentials & authenticates users |
SimpleSAMLphp | 8443 | External | SAML authentication service |
ApiGW | 8080 | Internal | No external access required |
UI | TBD | Local | Used for backend operations |
Verifier | TBD | Internal | Not yet fully implemented |
Registry | TBD | Internal | Not yet fully implemented |
MockAS | TBD | Internal | Testing authentication services |
MongoDB | 27017 | Internal | Backend database |
Jaeger | 16686 | Local | Used for monitoring and tracing |
The SimpleSAMLphp service acts as a SAML IdP, handling authentication requests from SATOSA. To function correctly, SATOSA must retrieve metadata from SimpleSAMLphp to determine how authentication should be performed.
When SATOSA starts, it must fetch metadata from SimpleSAMLphp. By default, the metadata is retrieved from:
https://simplesamlphp.example.com:8443/simplesaml/saml2/idp/metadata.php
This metadata contains essential details, including authentication endpoints where SATOSA must redirect users. SimpleSAMLphp generates this metadata based on how it is accessed—specifically, the hostname and port that SATOSA uses to connect.
SATOSA does not modify this metadata but relies on it as-is for authentication redirections.
After retrieving metadata, SATOSA follows this process to authenticate users:
User Initiates Authentication
SATOSA Redirects to SimpleSAMLphp
User Authenticates with SimpleSAMLphp
SATOSA Processes the Authentication Response
Since SATOSA retrieves metadata from SimpleSAMLphp, the authentication redirect URL is determined by this metadata.
If the hostname or port used during metadata retrieval differs from the one required during redirection, authentication will fail due to incorrect redirects.
https://simplesamlphp.example.com:8443
https://simplesamlphp.example.com:8443
during authentication.Authentication flows correctly avoids unnecessary failures by ensuring that SATOSA always retrieves metadata using the same hostname external users will use.
To successfully set up the VC-service infrastructure, follow these steps:
Clone the vc_up_and_running repository from GitHub:
git clone git@github.com:dc4eu/vc_up_and_running.git cd vc_up_and_running |
The environment is defined in the .env
file, which contains key configuration variables required for setting up and running the system. In most cases, modifying these variables is sufficient to configure the environment.
Changes to other files, such as the Docker Compose configuration, may lead to unexpected behavior and should only be made when necessary.
.env
File APIGW_HOST_PORT=8080 JAEGER_HOST_PORT=16686 TAG=0.5.17 DOCKERHUB_FQDN=docker.sunet.se NETWORK_NAME=dc4eu_shared_network ISSUER_HOST=issuer.example.com ISSUER_URL=https://issuer.example.com:8000 SAML_IDP_HOST=simplesamlphp.example.com SAML_MD_URL=https://simplesamlphp.example.com:8443/simplesaml/saml2/idp/metadata.php SAML_DS_URL=https://ds.example.com APIGW_HOST=apigw.example.com APIGW_URL=http://apigw.example.com:8080 CREDENTIAL_OFFER_URL=https://dc4eu.wwwallet.org/cb |
Explanation of
.env
Variables
TAG=0.5.17
Specifies the version tag of the deployed Docker images.
DOCKERHUB_FQDN=docker.sunet.se
Docker registry URL for pulling images.
NETWORK_NAME=dc4eu_shared_network
The name of the Docker network that all containers use for internal communication.
APIGW_HOST_PORT=8080
The port mapped to the host for accessing the API Gateway.
APIGW_HOST=apigw.example.com
The FQDN for the API Gateway.
APIGW_URL=http://apigw.example.com:8080
The full URL where ApiGW is accessible.
Important: The API Gateway uses HTTP, not HTTPS.
ISSUER_HOST=issuer.example.com
The FQDN of the SATOSA issuer service.
ISSUER_URL=https://issuer.example.com:8000
The full URL where the issuer service is accessible externally.
SAML_IDP_HOST=simplesamlphp.example.com
The FQDN of the SimpleSAMLphp identity provider.
Important: This hostname must be the same internally in Docker and externally, otherwise, SATOSA will generate incorrect authentication redirection URLs.
SAML_MD_URL=https://simplesamlphp.example.com:8443/simplesaml/saml2/idp/metadata.php
The URL where SATOSA retrieves SAML metadata from SimpleSAMLphp.
SAML_DS_URL=https://ds.example.com
The Discovery Service (DS) URL.
Ensure hostnames are correctly set
SAML_MD_URL
).Ensure required ports are open and properly mapped
By correctly configuring these variables, you ensure that services communicate properly and that the system functions as expected.
The start.sh script initializes the environment, generates the required keys and certificates, and starts the necessary services.
To run the script, execute:
./start.sh |
The script performs the following setup tasks:
This ensures that all necessary configurations are in place before the system starts running.
Once the environment is set up, you can manage the services as follows:
To start all services:
./start.sh |
To gracefully stop all running services:
./stop.sh |
This will shut down all containers while preserving the configuration and stored data.
Once the environment is running, you can access various services via the following URLs:
Service | URL |
---|---|
API Gateway (Swagger UI) | http://127.0.0.1:8080/swagger/index.html |
SimpleSAMLphp UI | https://simplesamlphp.example.com:8443/simplesaml/ |
SATOSA Metadata | https://issuer.example.com:8000/.well-known/openid-configuration |
Jaeger Tracing UI | http://127.0.0.1:16686 |
The API Gateway provides an interface to interact with backend services. Swagger UI allows you to test and explore available API endpoints.
The SimpleSAMLphp UI provides a web interface for managing SAML configurations and testing authentication.
The SATOSA Trust Infrastructure entity configuration can be accessed to verify that the service is running.
Jaeger provides tracing and monitoring of requests across the VC services.