|
1 | 1 | <a id="trouble-shooting-faq"></a> |
2 | 2 | > ##### Contents |
3 | | -> |
| 3 | +> |
4 | 4 | > * [Trouble shooting & FAQ](#id1) |
5 | 5 | > * [Reporting a problem with user provisioning or SSO authentication](#reporting-a-problem-with-user-provisioning-or-sso-authentication) |
6 | 6 | > * [Can I use SCIM without SAML?](#can-i-use-scim-without-saml) |
|
17 | 17 | > * [Can I distribute a URL to my users that contains the login code?](#can-i-distribute-a-url-to-my-users-that-contains-the-login-code) |
18 | 18 | > * [(Theoretical) name clashes in SAML NameIDs](#theoretical-name-clashes-in-saml-nameids) |
19 | 19 | > * [After logging in via IdP page, the redirection to the wire app is not happening](#after-logging-in-via-idp-page-the-redirection-to-the-wire-app-is-not-happening) |
| 20 | +> * [Getting "414 Request-URI Too Large" error during SAML SSO login](#getting-414-request-uri-too-large-error-during-saml-sso-login) |
20 | 21 |
|
21 | 22 | # Trouble shooting & FAQ |
22 | 23 |
|
@@ -400,3 +401,63 @@ See also: |
400 | 401 | [1](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/form-action), |
401 | 402 | [2](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy), |
402 | 403 | [3](https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP). |
| 404 | + |
| 405 | +## Getting "414 Request-URI Too Large" error during SAML SSO login |
| 406 | + |
| 407 | +**Problem:** After authenticating successfully at the IdP (Identity Provider), users are redirected back to Wire but encounter a `414 Request-URI Too Large` error. The URL contains a very long `SAMLResponse` query parameter. |
| 408 | + |
| 409 | +**Example URL causing the error:** |
| 410 | +``` |
| 411 | +https://nginz-https.example.com/sso/metadata?SAMLResponse=rZrXDq...very-long-base64-encoded-string... |
| 412 | +``` |
| 413 | + |
| 414 | +**Root cause:** This error occurs when using SAML with **HTTP Redirect binding** (where the SAML response is sent as a URL query parameter). Large SAML responses - particularly those with many user attributes, group memberships, or other metadata - can exceed nginx's default URL buffer size limit of 32KB. |
| 415 | + |
| 416 | +### Solutions |
| 417 | + |
| 418 | +You have two options to resolve this issue: |
| 419 | + |
| 420 | +#### Option 1: Switch to SAML HTTP POST Binding (Recommended) |
| 421 | + |
| 422 | +Configure your IdP to use **HTTP POST binding** instead of HTTP Redirect binding. With POST binding, the SAML response is sent in the request body rather than the URL, which avoids URL length limitations. |
| 423 | + |
| 424 | +**How to configure:** |
| 425 | +1. In your IdP (e.g., Okta, Azure AD, Authentik, etc.), locate the SAML application configuration |
| 426 | +2. Change the binding from "Redirect" to "POST" for the Assertion Consumer Service (ACS) |
| 427 | +3. Save and test the SSO login flow |
| 428 | + |
| 429 | +Consult your IdP's documentation for specific instructions on changing SAML bindings. |
| 430 | + |
| 431 | +#### Option 2: Increase nginx URL Buffer Size |
| 432 | + |
| 433 | +If you cannot change the IdP configuration to use POST binding, you can increase nginx's URL buffer size in the Wire backend: |
| 434 | + |
| 435 | +1. **Update your nginz helm chart values** (e.g., in your `values.yaml` override file): |
| 436 | + |
| 437 | + ```yaml |
| 438 | + nginx_conf: |
| 439 | + # Increase buffer size to handle large SAML responses in URLs |
| 440 | + # Format: "number size" - request line must fit in one buffer |
| 441 | + large_client_header_buffers: "4 32k" # Allows URLs up to 32KB |
| 442 | + ``` |
| 443 | +
|
| 444 | + For even larger SAML responses (if 32KB is still not enough): |
| 445 | + ```yaml |
| 446 | + nginx_conf: |
| 447 | + large_client_header_buffers: "4 64k" # Allows URLs up to 64KB |
| 448 | + ``` |
| 449 | +
|
| 450 | +2. **Redeploy the nginz service** with the updated configuration |
| 451 | +
|
| 452 | +3. **Test the SSO login flow** again |
| 453 | +
|
| 454 | +**Note:** The first value is the number of buffers, and the second is the size of each buffer. The request line (URL) must fit within a **single buffer**, not across multiple buffers. So `4 32k` means up to 32KB per URL, with 4 buffers available total (128KB) for all headers. |
| 455 | + |
| 456 | +### How to determine which binding is being used |
| 457 | + |
| 458 | +- **HTTP Redirect binding**: The SAMLResponse appears in the URL as a query parameter (`?SAMLResponse=...`) |
| 459 | +- **HTTP POST binding**: The URL is clean with no SAMLResponse parameter; the response is in the request body |
| 460 | + |
| 461 | +### Reference |
| 462 | + |
| 463 | +- Nginx directive documentation: [large_client_header_buffers](http://nginx.org/en/docs/http/ngx_http_core_module.html#large_client_header_buffers) |
0 commit comments