26.38. kych-eumw-bridge(1)#

26.38.1. Name#

kych-eumw-bridge - KyCH-native helper API in front of the Governikus eIDAS Middleware

26.38.2. Synopsis#

kych-eumw-bridge [–PROPERTY=VALUE …]

26.38.3. Description#

kych-eumw-bridge is the helper of two of KyCH’s vocabularies, each a route of its own that is on when it is configured:

  • npa (the German identity card’s online function, kind eid-server): the bridge is the eIDAS connector of the Governikus eIDAS Middleware, governikus-eumw(1);

  • eidas (other member states’ notified eIDs, kind eidas-saml): the bridge is the member-state-specific part of an EU eIDAS-Node Connector, eidas-node-connector(1) – see “The eidas route” below.

For both it implements the KyCH-native helper API for kych-oauth2-gateway(1). The npa route:

  1. KyCH starts a session (POST /sessions) with the attributes to read, under the eID server interface’s names (BSI TR-03130), and sends the person’s browser to the session’s browser_url, /npa/start/{id}.

  2. The bridge sends the browser to the middleware with an eIDAS SAML AuthnRequest (HTTP-Redirect binding, signed) for the corresponding eIDAS attributes, naming the middleware’s eID service provider for KyCH (requesterId, providerName).

  3. The middleware runs the identification with the person’s eID client and card, and the browser posts its SAML response to /npa/acs.

  4. The bridge decrypts the assertion and checks the middleware’s signature on the response and on the assertion – with the middleware’s own eidas-starterkit – and keeps the attributes under their TR-03130 names and the evidence; it notifies KyCH and sends the browser to KyCH’s /return/{verification_id}.

KyCH itself does no cryptography: everything SAML is done here.

This program is a thin wrapper around java -jar /usr/share/kych-eumw-bridge/kych-eumw-bridge.jar that picks the Java runtime as governikus-eumw(1) does. Arguments are passed on as Spring Boot properties.

26.38.4. The eidas route#

  1. KyCH starts a session of kind eidas-saml with the attributes to read, under the eIDAS SAML Attribute Profile’s URIs (http://eidas.europa.eu/attributes/naturalperson/...), and sends the browser to /eidas/start/{id}.

  2. The bridge asks for the person’s country when the Connector has more than one proxy service (BRIDGE_EIDAS_COUNTRIES), puts a light request for the attributes, the level of assurance and the service provider’s RequesterID into the Connector’s Hazelcast cache and sends the browser to the Connector’s SpecificConnectorRequest with the light token that names it (eIDAS-Node’s “specific communication”).

  3. The Connector signs an eIDAS SAML AuthnRequest to the proxy service of that country; the person identifies at home; the Connector checks the signed (and encrypted) SAML response against the proxy service’s metadata – signatures, decryption, destination, audience, validity, InResponseTo, level of assurance, replay – and sends the browser to /eidas/response with a light token for the light response.

  4. The bridge checks the token’s digest (the light tokens’ secrets are the Connector’s, from specificCommunicationDefinition.xml), takes the light response and the evidence beside it out of the cache (a token works once), checks the level of assurance and the required attributes, keeps the claims under their URIs and the evidence, notifies KyCH and sends the browser to KyCH’s /return/{verification_id}.

Every SAML signature and decryption is the Connector’s; the bridge’s own checks are the light token, the correlation of the light response with its request, the level of assurance and the attributes.

Claims are the values as the light response has them: names as text (of several values, a transliteration beside a name in non-Latin script, the one in Latin script), DateOfBirth YYYY-MM-DD, CurrentAddress base64 of the eIDAS address elements, Nationality alpha-2 (an array if a node sends several), PersonIdentifier XX/YY/.... Only the minimum data set is guaranteed (CurrentFamilyName, CurrentGivenName, DateOfBirth, PersonIdentifier); every other attribute is sent at the sending member state’s discretion and with the person’s consent, and KyCH reports it missing otherwise.

Failures: access_denied (the person cancelled or refused consent), loa_too_low (a level of assurance below BRIDGE_EIDAS_LEVEL_OF_ASSURANCE), invalid_response (the Connector reports a broken answer, or handed over no evidence while BRIDGE_EIDAS_REQUIRE_EVIDENCE is on), eid_error (anything else the proxy service reports), attribute_missing (a required attribute not delivered), presentation_expired, cancelled. An error the Connector finds itself – an untrusted or expired proxy service metadata, a response whose signature fails, a level of assurance below the one asked for – is shown on the Connector’s own error page and never comes back to the bridge: the session then expires.

The evidence: helper (kych-native, kych-eumw-bridge), format saml2, credential_type eidas-natural-person, issuer (country, the proxy service’s entity_id, the subject and chain of the certificate its signatures were checked against), trust (source: eidas-node, the connector, what it checked), level_of_assurance from the response, request (attributes, citizen country, level asked for, light request id, RequesterID) and presentation: {"format": "saml2-assertion", "assertion": base64, "response": base64, "name_id", "name_id_format"} – the decrypted assertion (signed by the proxy service where it signs assertions) and the SAML response as received (its signature covers the encrypted assertion). Both come from the Connector through eidas-node/patches/0001; without that patch the session fails, unless BRIDGE_EIDAS_REQUIRE_EVIDENCE=false.

26.38.5. Interfaces#

The management API (BRIDGE_API_UNIX_SOCKET)

The KyCH-native helper API, version 0:0:0: GET /config, POST /sessions, GET /sessions/{id}[?wait=], DELETE /sessions/{id} (api-kych-helper). Every request but /config needs Authorization: Bearer with the API secret. Paths under /npa/ answer 404 here.

The public interface (BRIDGE_PUBLIC_UNIX_SOCKET)

/npa/start/{id}, /npa/acs, /npa/metadata, /eidas/start/{id}, /eidas/response, which the reverse proxy publishes; nothing else answers here.

26.38.6. What the SAML route delivers#

The middleware hands out what an eIDAS node can carry, and the bridge maps it back:

  • GivenNames, FamilyNames: as read;

  • BirthName: the eIDAS birth name is “given names, birth name”; the given names are taken off;

  • DateOfBirth: {"DateString": "YYYYMMDD", "DateValue": "YYYY-MM-DD"}, DateValue only for a complete date;

  • PlaceOfBirth: {"FreetextPlace": ...}, also for a structured place (its city);

  • PlaceOfResidence: {"StructuredPlace": {"Street", "City", "State", "Country", "ZipCode"}}; a place given as free text or “no place” is left out by the middleware, and the attribute is then missing;

  • Nationality: ISO 3166-1 alpha-2 (the middleware converts the card’s ICAO code);

  • RestrictedID: {"ID": "<hex>"}, the card’s sector-specific identifier for the service provider.

DocumentType, IssuingState, DateOfExpiry, ArtisticName, AcademicTitle, CommunityID, ResidencePermitI, AgeVerification and PlaceVerification cannot be had: a session that requires one is refused (invalid_request), an optional one is reported missing by KyCH.

Failures: access_denied (the person cancelled, also after a wrong PIN), card_invalid (the eID server’s invalidDocument: expired, on the block list, or not authentic), eid_error (anything else the middleware reports; the hint carries its message), invalid_response (a SAML response that does not decrypt or verify), attribute_missing (a required attribute not delivered), presentation_expired, cancelled.

The evidence is KyCH’s: helper (kych-native, kych-eumw-bridge), credential_type de-eid, issuer (the middleware’s entity id and signature certificate), trust (source: eid-server, the service provider), level_of_assurance from the assertion, request (the attributes, the AuthnRequest id) and presentation: the decrypted assertion as the middleware signed it (saml2-assertion, base64). The online function leaves nothing else that could be checked later: the card proves itself to the eID server only.

Sessions are kept in memory: a restart loses them, and KyCH fails a session the bridge no longer knows.

26.38.7. Environment#

The package’s unit reads /etc/kych-eumw-bridge/kych-eumw-bridge.env, then local.env and secrets/keystore.env.

KYCH_EUMW_BRIDGE_JAVA_OPTS

Options for the JVM, e.g. -Xmx768m.

BRIDGE_API_UNIX_SOCKET, BRIDGE_API_UNIX_SOCKET_PERMISSIONS

The management API’s socket and its mode (e.g. rw-rw----). Without a socket, SERVER_ADDRESS/SERVER_PORT (default 127.0.0.1:18475).

BRIDGE_API_SECRET_FILE (or BRIDGE_API_SECRET)

The bearer secret: the API_SECRET = line of the file KyCH reads with @inline-secret@, or the file’s whole content.

BRIDGE_PUBLIC_UNIX_SOCKET, BRIDGE_PUBLIC_UNIX_SOCKET_PERMISSIONS

The public interface’s socket (or BRIDGE_PUBLIC_PORT, loopback).

BRIDGE_PUBLIC_BASE_URL

Where browsers reach /npa/, with the trailing slash. Required for npa.

BRIDGE_MIDDLEWARE_REQUEST_RECEIVER_URL

The middleware’s .../eidas-middleware/RequestReceiver. Setting it turns the npa route on; the other BRIDGE_MIDDLEWARE_* and BRIDGE_SAML_* settings are then required.

BRIDGE_MIDDLEWARE_SIGNATURE_CERTIFICATE

The certificate the middleware signs its responses with. Required for npa.

BRIDGE_MIDDLEWARE_METADATA_URL

Optional, for the evidence.

BRIDGE_SAML_SIGNATURE_KEYSTORE, ..._ALIAS, ..._PASSWORD

The PKCS#12 key the requests and the connector metadata are signed with.

BRIDGE_SAML_DECRYPTION_KEYSTORE, ..._ALIAS, ..._PASSWORD

The PKCS#12 key the middleware encrypts the assertions to.

BRIDGE_SAML_PROVIDER_NAME

The middleware’s eID service provider for KyCH (its name in the admin interface). Required.

BRIDGE_SAML_PERMITTED_ATTRIBUTES

The attributes (TR-03130 names, comma-separated) the provider’s authorisation certificate allows, i.e. its Berechtigung. A session that requires another is refused (invalid_request), an optional one is left out. Without it every attribute the route delivers is asked for – and a request beyond the certificate makes the middleware fail before AusweisApp gets its tcToken: the person sees an error in AusweisApp, no answer comes back, and the session expires.

BRIDGE_SAML_ENTITY_ID

The connector’s entity id; default the metadata URL, BRIDGE_PUBLIC_BASE_URL + metadata.

BRIDGE_EIDAS_CONNECTOR_REQUEST_URL

The Connector’s .../EidasNodeConnector/SpecificConnectorRequest as the browser reaches it. Setting it turns the eidas route on; eidas-node-connector-setup(1) --bridge-env writes it and the next four.

BRIDGE_EIDAS_BASE_URL

Where browsers reach /eidas/, with the trailing slash; BRIDGE_EIDAS_BASE_URL + response must be the Connector’s specific.connector.response.receiver. Required.

BRIDGE_EIDAS_SPECIFIC_COMMUNICATION_DEFINITION

The Connector’s specificCommunicationDefinition.xml, which holds the light tokens’ issuers, secrets and digest algorithm. The package adds the bridge’s user to the Connector’s group to read it. Required.

BRIDGE_EIDAS_COUNTRIES

The citizen countries the Connector has proxy services for (ISO 3166-1 alpha-2, comma-separated). With more than one, the bridge asks the person. Required.

BRIDGE_EIDAS_HAZELCAST_CLUSTER_NAME, BRIDGE_EIDAS_HAZELCAST_MEMBERS

The Connector’s specific-communication cache (default specificCommunication at 127.0.0.1:5501). The bridge joins it as a Hazelcast client; Hazelcast has no authentication, so the cache must be reachable from this host only.

BRIDGE_EIDAS_REQUESTER_ID

The service provider’s id, sent as the eIDAS RequesterID: an URI, unique within the Connector’s member state. Required.

BRIDGE_EIDAS_PROVIDER_NAME

The service provider’s name, which some proxy services show the person.

BRIDGE_EIDAS_LEVEL_OF_ASSURANCE (default high)

The lowest notified level of assurance asked for (minimum comparison) and accepted: low, substantial or high. § 12 Abs. 1 Nr. 4 GwG accepts only an eID scheme notified at level high.

BRIDGE_EIDAS_SP_TYPE (default empty)

private or public in the light request – only when the Connector does not publish its sector in its metadata (eidas-node-connector-setup --sector does), which it otherwise refuses.

BRIDGE_EIDAS_NAME_ID_FORMAT (default empty: the Connector’s)

The NameID format asked for.

BRIDGE_EIDAS_REQUIRE_EVIDENCE (default true)

Fail a session for which the Connector hands over no signed answer.

BRIDGE_SESSION_MAX_AGE (default 15m), BRIDGE_SESSION_RETENTION (default 10m)

The longest a session may last, and how long its outcome is kept after KyCH first fetched it (and the session after it ended).

26.38.8. KyCH’s side#

In kych.conf(5):

[kych-oauth2-gateway]
VOCABULARIES = {..., npa}
@inline-secret@ helper-eumw /etc/kych-eumw-bridge/secrets/api.secret.conf

The shipped defaults route [vocabulary-npa] and [vocabulary-eidas] to [helper-eumw] (TYPE = kych-native, the API socket): one bridge serves both, and its /config lists the kinds whose route is configured. For eidas, add eidas to VOCABULARIES.

26.38.9. See also#

governikus-eumw(1), eidas-node-connector(1), eidas-node-connector-setup(1), kych-oauth2-gateway(1), kych.conf(5).