Browser-based applications now interact with APIs directly, so the browser is no longer just a presentation layer. That changes the risk model because tokens, cookies, and refresh flows can be exposed to XSS, origin abuse, and replay. Legacy SAML websites often assumed a more bounded browser session, which does not fit API-centric design.
Why This Matters for Security Teams
Legacy SAML websites were built around a bounded session: a user authenticates once, the browser carries a cookie, and the application mostly serves pages. Browser-based applications are different. They call APIs directly, move data between origins, and often rely on access tokens and refresh flows that can be abused if exposed. That means the identity control problem shifts from session management to runtime token and origin protection.
For security teams, the practical mistake is assuming browser delivery automatically means the same control model. It does not. Controls that were sufficient for SAML redirects and server-side session state do not cover XSS, token replay, or origin abuse in API-centric apps. This is why guidance in the Ultimate Guide to NHIs and baseline control models like the NIST Cybersecurity Framework 2.0 are increasingly applied to browser-delivered workloads as identity surfaces expand.
NHIMG research shows how often identity assumptions fail under real-world pressure: 80% of identity breaches involved compromised non-human identities such as service accounts and API keys, and 79% of organisations have experienced secrets leaks. In practice, many security teams discover the mismatch only after tokens have been reused from a compromised browser context rather than through a planned redesign.
How It Works in Practice
Browser-based applications need controls that understand both the user session and the browser’s ability to act as an API client. The main difference is that identity is no longer just a login event. It is a continuous set of runtime decisions about token issuance, scope, audience, storage, and revalidation. In legacy SAML, the browser mainly transports assertions to create a server-side session. In modern web apps, the browser may hold bearer tokens, call APIs directly, and refresh credentials without a traditional session boundary.
That changes what “good” looks like:
- Use short-lived tokens with narrow audience and scope, so exposure has less blast radius.
- Prefer proof-of-possession or sender-constrained patterns where feasible, because bearer-only tokens are easier to replay.
- Protect against XSS with strong content controls, because script execution can steal or use tokens directly in-browser.
- Bind access to origin and runtime context, not just to a one-time authentication result.
- Reevaluate refresh behavior, because long-lived refresh tokens can become the highest-value target in the flow.
This is why browser app design increasingly intersects with NHI governance. A browser acting on behalf of a user can behave like a workload with credentials, which makes token lifecycle, storage, and revocation central controls. The Top 10 NHI Issues highlights the same operational pattern: once credentials are treated as durable artifacts instead of ephemeral trust signals, exposure becomes routine. Standards work such as the NIST Cybersecurity Framework 2.0 still applies, but the control implementation must shift to token-centric and API-aware enforcement.
Teams usually pair these controls with same-site cookie protections, CSRF defenses where cookies remain in use, strict redirect handling, and centralized token revocation. These controls tend to break down when a browser-based app depends on third-party scripts or multiple embedded origins because token exposure and origin confusion become difficult to contain.
Common Variations and Edge Cases
Tighter browser identity controls often increase implementation and support overhead, requiring organisations to balance security gain against developer friction and session reliability. That tradeoff is real, especially when legacy SAML websites are being modernized incrementally rather than rebuilt.
One common edge case is a hybrid application that still uses SAML for primary sign-in but then hands off to APIs and single-page app behavior after authentication. Current guidance suggests treating that as a transitional architecture, not as a legacy exception. The browser may still need modern protections even if the initial login is old-style. Another edge case is external identity federation, where the upstream IdP is strong but the downstream app stores tokens too broadly or refreshes them too aggressively.
There is no universal standard for this yet, but best practice is evolving toward explicit token lifecycle policy, runtime authorization checks, and browser confinement measures. The most relevant operational lesson from 52 NHI Breaches Analysis is that identity failures usually happen at the seams: between login and API use, between trusted origin and malicious script, or between short-term trust and long-term credential reuse. In mixed environments, teams should expect the weakest control path to be the browser-to-API handoff, especially when multiple frameworks, third-party widgets, or embedded admin tools share the same origin.
Standards & Framework Alignment
This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.
OWASP Non-Human Identity Top 10 and OWASP Agentic AI Top 10 address the attack and risk surface, while NIST CSF 2.0 set the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| OWASP Non-Human Identity Top 10 | NHI-01 | Browser apps expose tokens and secrets like other NHI flows, so lifecycle control matters. |
| NIST CSF 2.0 | PR.AC-1 | Identity proofing and access enforcement must move beyond legacy SAML session assumptions. |
| OWASP Agentic AI Top 10 | Runtime authorization and token misuse patterns overlap with modern autonomous web clients. |
Inventory browser-issued tokens, minimize lifetime, and revoke them immediately when the session changes.
Related resources from NHI Mgmt Group
- How can security teams balance user experience with stronger identity controls?
- What is the difference between a rules-based secret scanner and a hybrid scanner?
- What is the difference between code scanning and runtime identity monitoring?
- When does regex-based secret detection become too unreliable for production use?
Deepen Your Knowledge
Reviewed and updated by the NHIMG editorial team on June 8, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org