The Simplest Way to Make Gatling and SAML Work Like They Should
Using gatling and saml together lets teams run load tests on apps with single sign-on. Gatling sends web requests while SAML checks user login steps through an identity provider. Load testing an app behind a SAML login page takes extra setup work. Regular browser logins use redirects and hidden form values that simple scripts miss. Teams need a clear plan to handle identity tokens during high traffic runs. How login and data flow between gatling and saml Gatling works at the HTTP level rathe
Your coding agents run with your access.
Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.
Using gatling and saml together lets teams run load tests on apps with single sign-on. Gatling sends web requests while SAML checks user login steps through an identity provider.
Load testing an app behind a SAML login page takes extra setup work. Regular browser logins use redirects and hidden form values that simple scripts miss. Teams need a clear plan to handle identity tokens during high traffic runs.
How login and data flow between gatling and saml
Gatling works at the HTTP level rather than running a full web browser. When a virtual user visits a protected app, the app sends a redirect response. This redirect points the virtual user to the SAML identity provider login page.
The app also includes a signed SAML request inside that redirect message. Gatling must read this message and store the request value in a session variable. Next, Gatling sends user credentials to the identity provider through a form post.
If the login succeeds, the identity provider creates a signed XML assertion. It sends this assertion back to the virtual user inside an HTML form. A real browser submits this form to the app using a small script.
Because Gatling does not run page scripts, your test plan must do this step. The test reads the assertion from the page body and posts it forward. The app checks the XML signature, reads the user role, and starts a session.
Once the session cookie is set, Gatling can test the rest of the app. Each virtual user keeps its own cookie store during the entire test run. This separation lets you test how different user roles act under heavy load.
Common failure modes and how to scope roles
Many teams hit problems when they use one shared test account for every user. Thousands of logins from one account can trigger rate limits at the identity provider. It also makes the app cache a single user profile in memory.
SAML 2.0 + End-to-End Encryption: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
This caching hides real database slowdowns that happen when many distinct users log in. A better plan uses a pool of test accounts with distinct role assignments. You can feed these accounts into Gatling from a simple data file.
Broad permissions on test accounts create another big risk for engineering teams. If a test script has admin rights, a bad request might delete key data. Test accounts should only hold the exact roles needed for the test path.
Unlogged test traffic also causes trouble during security reviews and audits. Security teams see thousands of logins and cannot tell which engineer started the run. You should tag test traffic and keep clear logs of every test run.
Network paths between the load generator and the identity provider need careful scoping too. Do not open wide network rules just to let load generators reach login servers. Limit traffic to specific test subnets and turn off test accounts after the run.
Finally, watch out for expired SAML assertions during long soak tests. Assertions only last for a short window to keep sessions safe. Your Gatling script must check for session drops and log in again when needed.
Govern statements and responses across databases and APIs
Good config and scoped roles are needed setup. They do not check single queries in flight or mask sensitive fields in returned rows. Across Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, and internal HTTP endpoints, hoop.dev runs beside each supported service as an open-source proxy, a sidecar for your database or API.
First, hoop.dev guardrails block banned queries before they run. Then hoop.dev data masking rewrites matched sensitive values in responses in memory. The audit trail records every statement and verdict per resource. Furthermore, hoop.dev holds SOC 2 Type II and is open source on GitHub.
Frequently asked questions
Why do my SAML load tests fail at the login step?
Most failures happen when the script misses dynamic values like the SAML request token. Check that your script extracts both the SAML assertion and the relay state value.
Should we test the identity provider at full production load?
Only do this if you own the identity provider or have permission. Cloud identity providers often block high login rates unless you ask them first.
How can we test app performance without hitting SAML limits?
Run the SAML login step once per virtual user at the start. Then reuse the session cookie for many app requests during the rest of the test.
Related guides
In this post