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.


Components Overview

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.

Service Descriptions

SATOSA (External Issuer)

SimpleSAMLphp

API Gateway

UI Service

Issuer (Internal Issuer)

Verifier

Registry

MockAS

MongoDB

Jaeger


Connectivity Levels Explained

Understanding network layers is essential to configure the infrastructure correctly:

Internal (Inside Docker Network)

Local (Mapped to Host)

External (Internet-Accessible)


Port Summary Table

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:

ServicePortConnectivity TypeNotes
SATOSA8000ExternalIssues credentials & authenticates users
SimpleSAMLphp8443ExternalSAML authentication service
ApiGW8080InternalNo external access required
UITBDLocalUsed for backend operations
VerifierTBDInternalNot yet fully implemented
RegistryTBDInternalNot yet fully implemented
MockASTBDInternalTesting authentication services
MongoDB27017InternalBackend database
Jaeger16686LocalUsed for monitoring and tracing

SATOSA Authentication Flow

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.

Metadata Retrieval

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.

Authentication Flow

After retrieving metadata, SATOSA follows this process to authenticate users:

  1. User Initiates Authentication

  2. SATOSA Redirects to SimpleSAMLphp

  3. User Authenticates with SimpleSAMLphp

  4. SATOSA Processes the Authentication Response

Importance of Consistent Hostname and Port Configuration

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.

How to Prevent Issues:

Authentication flows correctly avoids unnecessary failures by ensuring that SATOSA always retrieves metadata using the same hostname external users will use.



Setting Up the Environment

To successfully set up the VC-service infrastructure, follow these steps:

Cloning the Repository

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

Configuring the Environment

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.

Example .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

General Configuration

API Gateway

Issuer (SATOSA)

SimpleSAMLphp (SAML IdP)

Jaeger Tracing

Credential Offer


Configuration Guidelines

By correctly configuring these variables, you ensure that services communicate properly and that the system functions as expected.

Running the Setup Script

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

What This Script Does

The script performs the following setup tasks:

This ensures that all necessary configurations are in place before the system starts running.


Starting and Stopping Services

Once the environment is set up, you can manage the services as follows:

Start Services

To start all services:

./start.sh

Stop Services

To gracefully stop all running services:

./stop.sh

This will shut down all containers while preserving the configuration and stored data.


Accessing the Services

Once the environment is running, you can access various services via the following URLs:

ServiceURL
API Gateway (Swagger UI)http://127.0.0.1:8080/swagger/index.html
SimpleSAMLphp UIhttps://simplesamlphp.example.com:8443/simplesaml/
SATOSA Metadatahttps://issuer.example.com:8000/.well-known/openid-configuration
Jaeger Tracing UIhttp://127.0.0.1:16686

API Gateway (Swagger UI)

The API Gateway provides an interface to interact with backend services. Swagger UI allows you to test and explore available API endpoints.

SimpleSAMLphp UI

The SimpleSAMLphp UI provides a web interface for managing SAML configurations and testing authentication.

SATOSA Metadata

The SATOSA Trust Infrastructure entity configuration can be accessed to verify that the service is running.

Jaeger Tracing UI

Jaeger provides tracing and monitoring of requests across the VC services.