Intermittent SAML HTTP 401 Authentication Errors in MarkLogic Behind an AWS Application Load Balancer
Users may experience intermittent HTTP 401 authentication failures when using SAML authentication in a multi-node MarkLogic cluster deployed behind a load balancer. Investigation shows that the SAML assertion is successfully validated by MarkLogic, but the authentication session is not completed because the SAML authentication state is lost during the authentication round trip. This can occur when the initial authentication request and the returned SAML response are processed by different nodes in the MarkLogic cluster. Configuring load balancer session persistence (stickiness/session affinity) for the duration of the authentication flow resolves the issue.