Skip to content

Commit 7215a5f

Browse files
RolandGuijtrolandmaartenba
authored
Correct BFF qs code for BFF v4, add warnings around SPAs without a backend. (#989)
* Correct BFF qs code for BFF v4, add warnings around SPAs without a backend. * Update src/content/docs/identityserver/quickstarts/javascript-clients/js-without-backend.md Co-authored-by: Maarten Balliauw <maarten.balliauw@duendesoftware.com> --------- Co-authored-by: roland <roland@duendesoftware.com> Co-authored-by: Maarten Balliauw <maarten.balliauw@duendesoftware.com>
1 parent 5018afb commit 7215a5f

3 files changed

Lines changed: 8 additions & 8 deletions

File tree

src/content/docs/identityserver/quickstarts/javascript-clients/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ protocol interactions on the client-side, including driving user authentication
2626
and token requests, session and token management, and token storage. This leads
2727
to more complex JavaScript, cross-browser incompatibilities, and a considerably
2828
higher attack surface. Since this style inherently needs to store security
29-
sensitive artifacts (like tokens) in JavaScript reachable locations, this style
30-
is not recommended. **Consequently, we don't offer a quickstart for this style**.
29+
sensitive artifacts (like tokens) in JavaScript reachable locations, **this style
30+
is not recommended**.
3131

3232
As the ["OAuth 2.0 for Browser-Based Apps" IETF/OAuth working group BCP
3333
document](https://datatracker.ietf.org/doc/html/draft-ietf-oauth-browser-based-apps)

src/content/docs/identityserver/quickstarts/javascript-clients/js-with-backend.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ Add the following to `src/JavaScriptClient/Program.cs`:
126126
options.GetClaimsFromUserInfoEndpoint = true;
127127
options.MapInboundClaims = false;
128128
}
129-
.ConfigureCookies()
129+
.ConfigureCookies(options => options.Cookie.SameSite = SameSiteMode.Strict)
130130
.AddRemoteApis();
131131

132132
var app = builder.Build();
@@ -464,7 +464,7 @@ API in the ASP.NET Core routing system. Add the code below to the endpoint confi
464464
.AsBffApiEndpoint();
465465

466466
app.MapRemoteBffApiEndpoint("/remote", new Uri("https://localhost:6001"))
467-
.WithAccessToken(Duende.Bff.AccessTokenManagement.RequiredTokenType.User);
467+
.WithAccessToken(RequiredTokenType.User);
468468
```
469469

470470
The call to the `AsBffApiEndpoint()` fluent helper method adds BFF support to

src/content/docs/identityserver/quickstarts/javascript-clients/js-without-backend.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ Connect/OAuth protocol interactions occur from the JavaScript code running in
2626
the browser. Also, invoking the API will be performed directly from the
2727
JavaScript in the browser.
2828

29-
This design adds complexity (and thus security concerns) to your application, so
30-
consider if the ["BFF" pattern](/identityserver/quickstarts/javascript-clients/js-with-backend.mdx) might be a better
31-
choice.
29+
**This design has security concerns. It is no longer recommended.** See [overview](index.md)
30+
for details.
31+
The current best practice uses the [BFF pattern](js-with-backend.mdx).
3232

3333
In this quickstart the user will log in to IdentityServer, invoke an API with an
3434
access token issued by IdentityServer, and logout of IdentityServer. All of this
@@ -37,7 +37,7 @@ will be driven from the JavaScript running in the browser.
3737
## New Project For The JavaScript Client
3838

3939
Create a new project for the JavaScript application. Beyond being able to serve
40-
your application's html and javascript, there are no requirements on the
40+
your application's HTML and javascript, there are no requirements on the
4141
backend. You could use anything from an empty ASP.NET Core application to a
4242
Node.js application. This quickstart will use an ASP.NET Core application.
4343

0 commit comments

Comments
 (0)