By NHI Mgmt Group Editorial TeamBased on Curity: “Modernize SAML Web Architectures the Right Way” (September 3, 2025)

TL;DR: Legacy SAML browser models are giving way to API-centric web architectures, but Curity argues that many modernisation projects still mishandle browser tokens, session handling, and backend complexity. The practical shift is clear: secure web design now depends on separating concerns, keeping tokens out of the browser, and treating APIs as the centre of data protection.


At a glance

What this is: This is an analysis of how web modernization changes identity and access design, with API-first architectures demanding stronger control over browser tokens, cookies, and session handling.

Why it matters: IAM and security teams need to align browser, API, and backend controls because legacy SAML-era assumptions do not map cleanly to modern web applications and can weaken data protection.


Context

Modern web architectures no longer revolve around a browser session as the primary control point. In API-first designs, identity, authorization, and data protection have to be coordinated across the browser, the API layer, and any backend-for-frontend or token-handling components.

The governance gap is that many modernization projects update application frameworks without rethinking where tokens live, where session state is enforced, or which layer owns sensitive data handling. That creates inconsistent control boundaries, especially when SAML-era patterns are carried into OAuth-based architectures.

For IAM and security teams, the core question is not whether the application uses modern standards. It is whether the identity model still assumes the browser can safely hold sensitive credentials and session logic that now belongs closer to the API side.


Key questions

Q: How should security teams modernize identity controls for API-first web applications?

A: Security teams should redesign the application around separate web and API responsibilities. The browser should handle presentation, while token issuance, session state, and authorization enforcement move to an API-side layer such as a backend for frontend or token handler pattern. That separation reduces credential exposure and makes control ownership clearer across IAM, application security, and API operations.

Q: Why do browser-held tokens create more risk in modern web architectures?

A: Browser-held tokens increase risk because they are more exposed to XSS, origin abuse, and misconfiguration than API-side message handling. When access or refresh tokens live in the frontend, the browser becomes part of the trust boundary. That expands the blast radius of compromise and makes session protection depend on controls the browser cannot reliably enforce alone.

Q: What breaks when teams keep using SAML-era web patterns for API-centric apps?

A: SAML-era patterns break when they assume the browser and website can carry the full security state. In API-centric apps, that creates awkward token handling, backend session complexity, and blurred ownership between frontend and API controls. The result is an architecture that may work functionally but is harder to secure, operate, and modernize over time.

Q: What is the difference between browser session control and API-side session control?

A: Browser session control keeps too much trust in the frontend, where it is exposed to client-side execution and cookie handling issues. API-side session control places credential transport, session state, and request enforcement closer to the resource owner. For modern web applications, that distinction is critical because APIs are now the real protection point for sensitive data.


Technical breakdown

Why SAML browser models struggle in API-first architectures

SAML browser profiles were built around a world where the browser was the main interaction layer and the website handled authorization with assertion-derived attributes. In modern applications, APIs are the unit of data access, so the browser is no longer the right place to carry the security burden. When teams keep treating browser sessions as the centre of control, they end up mixing presentation, authentication, and data authorization in ways that are hard to scale and harder to secure.

Practical implication: move authorization decisions closer to APIs instead of preserving browser-centric trust assumptions.

How OAuth changes token handling for web applications

OAuth-based web architectures separate the browser from API credentials by using access tokens, refresh tokens, and cookie transport patterns that support API calls. That shift improves fit for modern applications, but it also introduces new failure modes if tokens are left exposed in the browser or if cookie handling becomes too permissive. The article’s security logic is that browser-side token storage expands the attack surface, especially when XSS or origin abuse can reach session material.

Practical implication: keep OAuth tokens out of the browser and use hardened, short-lived cookie patterns for API transport.

Why backend-for-frontend patterns reduce web security complexity

A backend for frontend, or token handler pattern, moves session and token orchestration into the API side of the architecture. That lets frontend teams use lighter static hosting while utility APIs and proxy components handle OAuth code flow, cookie issuance, backend expiry handling, and logging. The architectural point is not just convenience. It is separation of concerns, so web developers are not forced to own backend data security logic that belongs with the API estate.

Practical implication: place session management and cookie control in a dedicated API-side layer rather than inside the web frontend.


NHI Mgmt Group analysis

API-first web modernization turns the browser into an edge channel, not the trust centre. The old assumption that a browser session can safely carry the core security state no longer holds when APIs govern sensitive data. That assumption breaks because authorization now depends on backend enforcement, not on frontend-held attributes or long-lived browser state. Practitioners should treat the browser as a presentation layer with tightly constrained credential handling.

Browser token exposure is the real control failure in many modernization efforts. Moving from SAML to OAuth is not inherently safer if access tokens, refresh tokens, or long-lived cookies are left exposed to the frontend. The article’s security logic is that token placement matters as much as token format. Teams need to recognise that browser-held credentials create a wider blast radius than API-side message handling.

Separation of concerns is becoming an identity governance requirement, not just an engineering preference. When web teams are forced to manage session persistence, token exchange, and API routing in the same layer, control ownership becomes blurred. That increases operational complexity and weakens assurance boundaries across IAM, application security, and API governance. The practical conclusion is that identity controls must be designed around the architecture, not retrofitted into it.

Modern browser security depends on API-side enforcement of session boundaries. Short-lived cookies, SameSite and CORS controls, and proxy-based protections matter because they constrain how browser requests reach APIs. Those controls are only effective when session logic, credential transport, and backend error handling are separated cleanly. Practitioners should align web modernization with API governance rather than treating frontend refresh patterns as a self-contained fix.

Token handler patterns illustrate where modern identity control is heading. As web applications become more API-centric, the control plane shifts toward lightweight frontend delivery backed by dedicated identity and API enforcement components. That does not eliminate identity risk. It changes where the risk must be governed. The implication for practitioners is to redesign web authentication flows around backend-managed trust boundaries.

What this signals

Browser trust is becoming an architectural liability: modern web programmes should stop assuming that the frontend is an acceptable place to hold meaningful identity state. When APIs enforce the real access boundary, session and token logic belongs closer to those APIs than to the browser.

API-first modernisation changes the governance model: teams need to decide which controls live with the web layer and which live with the data layer. The practical test is whether a browser compromise can still expose credentials or session state that should have been isolated elsewhere.

Modern web identity design is moving toward separated control planes: lightweight static delivery, dedicated API-side enforcement, and short-lived browser credentials are becoming the more defensible pattern. That shift matters because it reduces the number of places where identity, application, and data security overlap in fragile ways.


For practitioners

  • Separate browser and API responsibilities Design the browser as a presentation layer and keep session state, token handling, and authorization enforcement on the API side of the architecture.
  • Keep OAuth tokens out of the browser Use hardened cookie transport patterns and avoid exposing access or refresh tokens to frontend code or persistent browser storage.
  • Adopt backend-for-frontend controls Place OAuth code flow handling, cookie issuance, and API request mediation in a dedicated backend-for-frontend layer instead of distributing those duties across the UI stack.
  • Review XSS exposure in modern web apps Treat cross-site scripting as a primary browser-side risk because it can undermine any token strategy that leaves credentials reachable from frontend execution contexts.

Key takeaways

  • Modern web modernization is not just a framework upgrade. It is a redesign of where identity state, authorization, and data protection should live.
  • Browser-held tokens and session logic are harder to govern safely when APIs, not the browser, are the real enforcement point for sensitive data.
  • The strongest pattern is architectural separation, with browser presentation kept lightweight and security controls concentrated on the API side.

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 API Security Top 10 address the attack and risk surface, while NIST CSF 2.0 and NIST Zero Trust (SP 800-207) set the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
OWASP Non-Human Identity Top 10NHI-02 — Secret LeakageBrowser-held tokens and cookies increase exposure if they are accessible to frontend code.
NHI-04 — Insecure AuthenticationThe article contrasts outdated SAML browser patterns with modern OAuth-based identity flows.
Recommendation — Keep tokens out of the browser and restrict credential exposure to API-side transport. Review authentication flow design so browser sessions do not become the primary trust anchor.
NIST CSF 2.0PR.AA-05 — Access Permissions, Entitlements and AuthorizationsThe article is about where authorization should be enforced in API-first web architecture.
Recommendation — Align authorization decisions with the API layer rather than the frontend.
NIST Zero Trust (SP 800-207)3.4 — Access to ResourcesThe architecture shifts access enforcement toward resource-side control boundaries.
Recommendation — Apply resource-centric access enforcement so browsers do not carry the full security state.
OWASP API Security Top 10API2 — Broken AuthenticationAPI authentication and token transport are central to the modern web pattern described here.
Recommendation — Validate API authentication flows and avoid patterns that expose reusable credentials to the client.

Key terms

  • Backend For Frontend: A backend for frontend is a server-side layer built specifically for one client application, such as a web app or mobile app. It aggregates data, enforces session checks, and keeps privileged API credentials away from distributed client code, which makes it a control boundary as well as an architecture pattern.
  • Token Handler Pattern: The token handler pattern moves browser credential handling into a controlled backend layer rather than leaving tokens in frontend code. It is especially useful when web applications need short-lived API credentials, strong cookie governance, and a clear separation between presentation and authorization responsibilities.
  • API-First Strategy: An API-first strategy treats application programming interfaces as the primary way systems are designed, built, and integrated. It defines contracts before implementation so services, data, and workflows can be consumed consistently by humans, applications, and agents. In identity security, it supports automation, policy enforcement, and controlled access across distributed environments.
  • Browser Session Boundary: The browser session boundary is the trust perimeter created when a user authenticates to a SaaS application in a browser. In agentic environments, that boundary can be shared by a human and an automated actor, which makes authorization, attribution, and revocation materially harder.

Deepen your knowledge

NHI governance, agentic AI identity, and machine identity lifecycle are core topics in our NHI Foundation Level course, the industry's only accredited NHI security programme. If you are building or maturing an IAM programme, it is worth exploring.
NHIMG Editorial Note
Published by the NHIMG editorial team on June 8, 2026.
Updated on October 10, 2026.
NHI Mgmt Group, the independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org