










Joe DeCock follows the OAuth working group, the OpenID Foundation, and the IETF and writes up what matters for working developers. Follow Joe on LinkedIn to catch his commentary as these standards evolve, and subscribe to the Duende newsletter using the form at the bottom of this page for implementation guidance, security updates, and deep dives delivered to your inbox.
If you've been following the identity standards world (or reading this blog), you know that the OAuth 2.0 for Browser-Based Applications specification has been in draft form for years. I mentioned it in my summer standards recap when it was finally submitted to the IESG for publication. It was one of those documents that everyone referenced, everyone agreed with, but that had been stuck behind various dependencies for a long time.
Well, it's done. The specification has been published as RFC 10017, formally designated as BCP 212.
RFC 10017 is the IETF's Best Current Practice document for building browser-based applications (SPAs, JavaScript frontends, anything running in the browser) that use OAuth 2.0. It was authored by Aaron Parecki, Philippe De Ryck (who you may recognize from his guest appearance on our YouTube channel), and David Waite. The document details the threats, attack consequences, security considerations, and architectural patterns that developers need to understand when building these kinds of applications.
The core recommendation: pair your browser-based application with a server-side component, a Backend for Frontend (BFF), that acts as a confidential OAuth client, manages tokens server-side, and proxies API requests on behalf of the frontend.
If that sounds familiar, it should. We at Duende have been saying exactly this for years and building the tooling to make it practical.
You might be thinking: "We've been following this guidance already. What changes?" Fair question. The core advice (use a BFF, don't expose tokens to JavaScript, don't use the Implicit grant) has been stable for a long time. We wrote about it when we released BFF v3 in 2025, and again when we explained why now is an excellent time to adopt BFF.
But the difference between a draft and an RFC is meaningful in ways that go beyond the technical content:
RFC 10017 describes three architectural patterns for browser-based OAuth applications, presented in decreasing order of security:
The BFF acts as a confidential OAuth client. It handles the Authorization Code flow with PKCE, manages access and refresh tokens server-side, and maintains a cookie-based session with the browser. The frontend never sees a token. API requests go through the BFF, which attaches the appropriate access token before forwarding to resource servers.
This is the pattern we implement in Duende BFF.
Similar to the BFF in that a backend handles OAuth responsibilities, but the frontend calls resource servers directly using access tokens obtained from the backend. This exposes tokens to JavaScript, which is less secure than the full BFF pattern.
The frontend handles everything: authorization flows, token storage, API calls. This is the least secure option, and the RFC is very clear about the risks. Malicious JavaScript running in the same origin has the same privileges as your legitimate application code. It can steal tokens, run silent authorization flows in hidden iframes, or simply proxy requests through the user's browser. If you want to see some of these attacks in action, Erwin van der Valk demonstrated them in a livestream on our YouTube channel.
One of the most valuable sections of RFC 10017 is its analysis of what malicious JavaScript can actually do to a browser-based OAuth client. The RFC walks through four attack scenarios:
The BFF pattern mitigates most of these. Since tokens never reach the browser, there's nothing to steal. Since the BFF is a confidential client, an attacker can't run a new flow from the browser. The one attack that remains is proxying requests through the user's session, but that's the same risk that exists with any cookie-based web application, and it's well understood.
If you're already using the BFF pattern, whether with Duende BFF or another implementation, you're in great shape. You've been following the best current practice before it was officially the Best Current Practice.
If you're not, the publication of RFC 10017 is a good reason to revisit your SPA security posture. We've written extensively about why this pattern matters and how to get started:
The RFC lays out the risks clearly, the pattern isn't hard to adopt, and we have the tooling and samples to get you there.
The full text of RFC 10017 is available at https://www.rfc-editor.org/info/rfc10017. It's well written and worth reading in full, especially the threat analysis sections and the detailed BFF implementation guidance including cookie security requirements and CSRF protections.
If you have questions about implementing the BFF pattern or want to discuss how RFC 10017 applies to your architecture, come find me on our Discord. I'm always excited to talk about identity standards, specs, and the security problems they solve.
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。