EE specific eIDAS proxy service
1. Building the SpecifcProxyService webapp
First, make sure you have built eIDAS-Node artifacts and installed these to the local Maven repository:
cd EIDAS-Parent && mvn clean install -P NodeOnly,DemoToolsOnly -PnodeJcacheIgnite,specificCommunicationJcacheIgnite
Then execute the following command:
./mvnw clean package
2. Integration with EidasNode webapp
In order to enable communication between EidasNode and SpecificProxyService webapps, both must be able to access the same Ignite cluster and have the same communication configuration (shared secret, etc).
NB! It is assumed that the SpecificProxyService webapp is installed in the same web server instance as EidasNode and that both have access to the same configuration files.
2.1 Configuring communication with EidasNode
To set the same communication definitions, it is required that the SpecificProxyService has access to communication definitions provided in the following EidasNode configuration file:
$SPECIFIC_PROXY_SERVICE_CONFIG_REPOSITORY/specificCommunicationDefinition.xml
2.2 Ignite configuration
By default it is assumed that EidasNode and SpecificProxyService will share the same xml configuration file and that the Ignite configuration can be found at EIDAS_PROXY_CONFIG_REPOSITORY/ignite/igniteSpecificCommunication.xml. The configuration location can be overridden (see to configuration parameters for further details).
The SpecificProxyService webapp starts an Ignite node in client mode using EidasNode webapp's Ignite configuration. The ignite client is started lazily (initialized on the first query).
Note that SpecificProxyService requires access to four predefined maps in the cluster - see Table 1 for details.
| Map name |
Description |
nodeSpecificProxyserviceRequestCache |
Holds pending LightRequests from EidasNode webapp. |
specificNodeProxyserviceResponseCache |
Holds LightResponses for EidasNode webapp. |
specificMSIdpRequestCorrelationMap |
Holds pending IDP authentication requests. |
specificMSIdpConsentCorrelationMap |
Holds pending user consent requests. |
Table 1 - Required shared map's in SpecificProxyService webapp.
An example of a configuration file is provided here.
3. Integration with the IDP (OpenID Connect server)
3.1 Requirements for IDP
The SpecificProxyService webapp delegates the eIDAS authentication request to a OIDC server.
The IDP integration requires the following OpenID Connect protocol features:
The following optional claims are mandatory in the ID token (in addition to other required claims listed in the OpenID Connect Core specification):
jti - A unique identifier for the token
amr - Authentication Method References
acr - Authentication Context Class Reference
3.2 Request eIDAS attributes using OpenID Connect scopes
SpecificProxyService webapp allows to map the eIDAS attributes in the incoming authentication request to custom OpenID Connect scopes (see configruation reference for more details). These custom scopes are automatically appended to the list of requested scopes in the OpenID Connect authentication request.
3.3 Find eIDAS attribute values from the OpenID Connect ID Token
Information about the authenticated person is retrieved from ID-token issued by the IDP (retuned in the response of OIDC token request).
Claims in the ID-token are mapped to their respective eIDAS attributes (see configuration reference for further details).
In some cases, ID-token claim values might need further processing to extract the attributed value.
4. Logging
Logging in SpecificProxyService is handled by Logback framework through the SLF4J facade.
4.1 Log configuration
Logging can be configured by using an xml configuration file (logback-spring.xml). By default the SpecificProxyService webapp uses an example configuration embedded in the service application, that logs into a file - /var/log/SpecificProxyService-yyyy-mm-dd.log and rotates active file daily. Console logging is disabled by default.
Logging behavior can be customized in the following ways:
By overriding the specific parameter values in the default logback-spring.xml configuration file with environment variables (see table 4.1.1)
Table 4.1.1 - properties in the default log confguration file
| Parameter |
Mandatory |
Description, example |
LOG_HOME |
No |
Directory for log files. Defaults to /var/log, if not specified. |
LOG_CONSOLE_LEVEL |
No |
Level of detail for console logger. Valid values are: OFF, FATAL, ERROR, WARN, INFO, DEBUG, TRACE. Defaults to OFF, if not specified. |
LOG_CONSOLE_PATTERN |
No |
Log row pattern for console logs. |
LOG_FILE_LEVEL |
No |
Level of detail for file logger. Valid values are: OFF, FATAL, ERROR, WARN, INFO, DEBUG, TRACE. Defaults to INFO, if not specified. |
LOG_FILES_MAX_COUNT |
No |
The number days rotated log files are kept locally. Defaults to 31, if not specified. |
APP_INSTANCE_ID |
No |
A unique application identifier. Defaults to a unique UUID (generated by the webapp at startup) if not specified. |
Custom logging configuration file can be provided for more detailed logging control. Log file location can be specified by using the environment variable LOGGING_CONFIG, Java system property logging.config or property providing the property logging.config in the application.properties file.
Example 1: overriding the default log conf with environment variable:
LOGGING_CONFIG=/etc/eidas/config/logback.xml
Example 2: overriding the default log conf with Java system property:
-Dlogging.config=/etc/eidas/config/logback.xml
Example 3: overriding the default log conf in the application.properties:
logging.config=file:/etc/eidas/config/logback.xml
4.2 Log file and format
By default the SpecificProxyService webapp uses an example configuration embedded in the service application, that logs into a file - /var/log/SpecificProxyService-yyyy-mm-dd.log.
JSON format is used for a log row. The JSON field set for a single log record follows the ECS Field reference.
The following log record fields are supported:
| Parameter |
Mandatory |
Description, example |
@timestamp |
Yes |
Date/time when the event originated. |
log.level |
Yes |
Original log level of the log event. Possible values: ERROR, WARN, INFO, DEBUG, TRACE |
log.logger |
Yes |
The name of the logger inside an application. |
process.pid |
Yes |
Process ID. |
process.thread.name |
Yes |
Thread name. |
service.name |
Yes |
Name of the service data is collected from. Constant value: ee-eidas-proxy. |
service.type |
Yes |
The type of the service data is collected from. Constant value: specific. |
service.node.name |
Yes |
Unique name of a service node. This allows for two nodes of the same service running on the same host to be differentiated. |
service.version |
No |
Version of the service. |
session.id |
No |
Unique identifier of the session. Cookie based identifier that enables log correlation between EidasNode and SpecificProxyService webapps. |
trace.id |
No |
Unique identifier of the session. Groups multiple events like transactions that belong together. For example, a user request handled by multiple inter-connected services. |
transaction.id |
No |
Unique identifier of the transaction. A transaction is the highest level of work measured within a service, such as a request to a server. |
message |
Yes |
The log message. |
error.type |
No |
The type of the error - the class name of the exception. |
error.stack_trace |
No |
The stack trace of this error in plain text. |
Example log message:
{
"@timestamp": "2020-06-26T17:38:09,388Z",
"log.level": "INFO",
"log.logger": "e.r.e.p.s.s.SpecificProxyServiceCommunication",
"process.pid": 2447,
"process.thread.name": "https-openssl-nio-8083-exec-4",
"service.name": "ee-eidas-proxy",
"service.type": "specific",
"service.node.name": "specificproxy-8ie7665",
"session.id": "43CB9681C492423DFA5DBF892ABA693C",
"trace.id": "49eb6edf9621cea5",
"transaction.id": "49eb6edf9621cea5",
"message": "Request with ID: 'e1b4f4a9-f59e-44b0-aa17-6acc76ad0412' received"
}
6. Monitoring
SpecificProxyService webapp uses Spring Boot Actuator