DEV Community

jeffrey
jeffrey

Posted on

SAML ECP moves authentication into a proxy path that still needs channel binding

SAML ECP moves authentication into a proxy path that still needs channel binding

The SAML V2.0 Enhanced Client or Proxy profile serves clients that can contact an identity provider without the browser redirects used by ordinary web single sign-on. It uses the Reverse SOAP binding, or PAOS, so an HTTP client can act as a SOAP responder. The exchange works through clients and gateway proxies, which makes the trust relationship among the client, service provider, and identity provider different from a browser SSO flow.

In an ECP request, the client sends an HTTP request to the service provider with a PAOS header that indicates the profile and binding capabilities. The service provider returns a SOAP envelope containing a SAML authentication request and PAOS headers that tell the client where to send the response. The client forwards the request to the identity provider, receives a SOAP response, and returns the SAML response to the service provider's assertion consumer service.

Every hop in that sequence needs a clear identity. RFC 5056 describes channel binding as evidence that the endpoints at a higher layer are the same endpoints as a protected lower-layer channel. The SAML ECP profile can carry channel-binding information in SOAP headers when the client advertises the channel-binding option. The service provider can then bind the authentication exchange to the channel it shares with the client. Without that binding, a proxy may be able to move a response to a different channel or present a valid assertion in the wrong context.

Treat the gateway as an authentication component

An ECP gateway or reverse proxy often terminates TLS, constructs PAOS requests, and forwards identity assertions. Its configuration is part of the authentication path. The proxy should use a dedicated service identity, validate the service provider certificate, and avoid accepting a client-supplied SAML response or identity header without a signature and expected audience.

The service provider should require its own audience value in the assertion and verify the response recipient. It should also check the issuer signature, subject confirmation, conditions, and response status. The ECP profile can permit holder-of-key confirmation, but the deployment still has to prove possession of the key. An ECP flow that only verifies that the SOAP message arrived over TLS has authenticated the channel, not necessarily the principal.

Bind the protocol to the channel

Channel binding is not automatic. The client must advertise support, the service provider must include the binding data, and the identity provider must pass the relevant information through the profile. The deployment should record the binding type, endpoint certificate, channel lifetime, and which component verifies the value. tls-server-end-point binds to the server certificate; other mechanisms may bind to a channel or endpoint property. Using a value that both sides cannot compute independently produces a check that always passes or always fails.

Test the path through the actual proxy. A direct client that works against the service provider may fail when its gateway rewrites the PAOS endpoint, drops SOAP headers, or reuses a TLS connection for a different request. The test should show that a missing or altered binding value is rejected and that the failure is logged with the right correlation identifier.

Operate ECP as a separate service

Inventory the ECP endpoint separately from browser SSO. Record its certificate, PAOS endpoint, identity providers, service providers, channel-binding policy, and timeout. Restrict the endpoint to clients and networks that need it, and monitor malformed SOAP envelopes, unexpected issuer values, audience failures, and binding mismatches.

The proxy should not log complete assertions or private keys. It can log issuer, audience, subject identifier hash, response status, binding type, and correlation ID. Those fields are enough to investigate a failed login without turning the log into a credential store.

ECP is a specialized profile for clients that cannot follow the browser redirect model. Its security depends on treating the proxy path as an authentication boundary, preserving the SOAP and PAOS semantics, and verifying that the assertion and lower-layer channel refer to the same exchange.

References

Top comments (0)