SAML/SSO: Logins are failed/inconsistent as sessions are switching between Confluence Data Center nodes, installed in Kubernetes with Nginx Ingress Controller as load balancer
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Summary
When login to confluence site which is hosted in Kubernetes and integrated with SAML/SSO, the client (browser) is switching sessions from one node to the other node and hence login failed.
This can confirmed by verifying the "NodeID" that is printed at the bottom of Confluence page - if that NodeID is changing during login then the load balancer is not persisting sessions and the client is "bouncing" between nodes.
Environment
Kubernetes
Atlassian DC Helm Charts
Confluence Multi node instance
nginx ingress controller/load balancer
SAML/SSO
Diagnosis
All versions of confluence (multi node) installed in Kubernetes with NGINX Ingress/Ingress Controller as load balancer and integrated with SAML/SSO
We highly suggest to check with your load balancer/Proxy server team before adding/updating any annotations in load balancer/proxy server as it could lead the site to security vulnerabilities
Cause
Session Affinity, or "Sticky Sessions" cookie is not persistent on the load balancer.
Sometimes browser let the cookie through and sometimes not.
Solution
The steps for implementing this feature differs from load balancer vendor to vendor, look for "Session Affinity" or "Sticky Sessions" and ensure this is enabled.
For this particular issue which is related to Kubernetes Nginx Ingress Controller, adding below Annotation would help to fix this specific problem.
1
nginx.ingress.kubernetes.io/session-cookie-samesite: None
SameSite=None cookies means that the browser sends the cookie with both cross-site and same-site requests.
The Secure attribute must also be set when setting this value.
None
cookies arealwayssent, regardless of whether you're in a same-site or cross-site scenario.
Was this helpful?