Skip to content

WK Bridge: Sign-in through Węzeł Krajowy

WK Bridge connects Keycloak to Węzeł Krajowy over SAML. It acts as an identity provider (IdP) for Keycloak and as a service provider (SP) for Węzeł Krajowy. The bridge runs on AWS Lambda behind API Gateway, with no dedicated VPS.

Sign-in flow: browser and Keycloak, API Gateway and the bridge on Lambda, SOAP through a NAT gateway to Węzeł Krajowy, DynamoDB, and Secrets Manager

Sign-in flow

  1. Keycloak initiates sign-in. It directs the browser to WK Bridge. API Gateway passes the SAML request to the Lambda function.
  2. The user authenticates with Węzeł Krajowy. The bridge directs the browser there. After authentication, Węzeł Krajowy sends a SAML artifact through the browser. The artifact is a reference to the actual response.
  3. The bridge retrieves the response. It calls ArtifactResolve directly on Węzeł Krajowy over SOAP. This connection uses a managed NAT gateway and does not pass through the user's browser.
  4. Keycloak receives the SAML response. The bridge returns it through the browser. Keycloak completes the portal sign-in.

Transaction state and signing material

DynamoDB holds temporary SAML transaction state so consecutive steps can use different Lambda environments. AWS Secrets Manager stores material for signing and verifying messages.