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, kindeid-server): the bridge is the eIDAS connector of the Governikus eIDAS Middleware, governikus-eumw(1);eidas(other member states’ notified eIDs, kindeidas-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:
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’sbrowser_url,/npa/start/{id}.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).The middleware runs the identification with the person’s eID client and card, and the browser posts its SAML response to
/npa/acs.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#
KyCH starts a session of kind
eidas-samlwith 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}.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’sSpecificConnectorRequestwith the light token that names it (eIDAS-Node’s “specific communication”).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/responsewith a light token for the light response.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/configneedsAuthorization: Bearerwith 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"},DateValueonly 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_OPTSOptions for the JVM, e.g.
-Xmx768m.BRIDGE_API_UNIX_SOCKET,BRIDGE_API_UNIX_SOCKET_PERMISSIONSThe 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(orBRIDGE_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_PERMISSIONSThe public interface’s socket (or
BRIDGE_PUBLIC_PORT, loopback).BRIDGE_PUBLIC_BASE_URLWhere browsers reach
/npa/, with the trailing slash. Required for npa.BRIDGE_MIDDLEWARE_REQUEST_RECEIVER_URLThe middleware’s
.../eidas-middleware/RequestReceiver. Setting it turns the npa route on; the otherBRIDGE_MIDDLEWARE_*andBRIDGE_SAML_*settings are then required.BRIDGE_MIDDLEWARE_SIGNATURE_CERTIFICATEThe certificate the middleware signs its responses with. Required for npa.
BRIDGE_MIDDLEWARE_METADATA_URLOptional, for the evidence.
BRIDGE_SAML_SIGNATURE_KEYSTORE,..._ALIAS,..._PASSWORDThe PKCS#12 key the requests and the connector metadata are signed with.
BRIDGE_SAML_DECRYPTION_KEYSTORE,..._ALIAS,..._PASSWORDThe PKCS#12 key the middleware encrypts the assertions to.
BRIDGE_SAML_PROVIDER_NAMEThe middleware’s eID service provider for KyCH (its name in the admin interface). Required.
BRIDGE_SAML_PERMITTED_ATTRIBUTESThe 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_IDThe connector’s entity id; default the metadata URL,
BRIDGE_PUBLIC_BASE_URL+metadata.BRIDGE_EIDAS_CONNECTOR_REQUEST_URLThe Connector’s
.../EidasNodeConnector/SpecificConnectorRequestas the browser reaches it. Setting it turns the eidas route on; eidas-node-connector-setup(1)--bridge-envwrites it and the next four.BRIDGE_EIDAS_BASE_URLWhere browsers reach
/eidas/, with the trailing slash;BRIDGE_EIDAS_BASE_URL+responsemust be the Connector’sspecific.connector.response.receiver. Required.BRIDGE_EIDAS_SPECIFIC_COMMUNICATION_DEFINITIONThe 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_COUNTRIESThe 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_MEMBERSThe Connector’s specific-communication cache (default
specificCommunicationat127.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_IDThe service provider’s id, sent as the eIDAS RequesterID: an URI, unique within the Connector’s member state. Required.
BRIDGE_EIDAS_PROVIDER_NAMEThe service provider’s name, which some proxy services show the person.
BRIDGE_EIDAS_LEVEL_OF_ASSURANCE(defaulthigh)The lowest notified level of assurance asked for (
minimumcomparison) and accepted:low,substantialorhigh. § 12 Abs. 1 Nr. 4 GwG accepts only an eID scheme notified at level high.BRIDGE_EIDAS_SP_TYPE(default empty)privateorpublicin the light request – only when the Connector does not publish its sector in its metadata (eidas-node-connector-setup--sectordoes), which it otherwise refuses.BRIDGE_EIDAS_NAME_ID_FORMAT(default empty: the Connector’s)The NameID format asked for.
BRIDGE_EIDAS_REQUIRE_EVIDENCE(defaulttrue)Fail a session for which the Connector hands over no signed answer.
BRIDGE_SESSION_MAX_AGE(default15m),BRIDGE_SESSION_RETENTION(default10m)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).