Skip to content

Commit 9a95d1d

Browse files
committed
Added clarification on the new way to achieve silent login
1 parent 89c714c commit 9a95d1d

3 files changed

Lines changed: 22 additions & 7 deletions

File tree

astro/src/content/docs/bff/fundamentals/session/management/index.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ builder.Services.AddBff(options =>
2828
};
2929
```
3030

31-
Starting with BFF v4, the BFF automatically wires up the management endpoints. If you disable this behavior (using `AutomaticallyRegisterBffMiddleware`, this is how you can map the management endpoints:
31+
Starting with BFF v4, the BFF automatically wires up the management endpoints. If you disable this behavior (using `AutomaticallyRegisterBffMiddleware`), this is how you can map the management endpoints:
3232

3333
```csharp
3434
// Program.cs
@@ -51,10 +51,9 @@ The `UsePreprocessing` method adds all handling for multiple frontend support. A
5151
``` csharp
5252
app.UseBffFrontendSelection();
5353
app.UseBffPathMapping();
54-
app.UseBffOpenIdCallbacks();~
54+
app.UseBffOpenIdCallbacks();
5555
```
5656

57-
5857
`UseBffPostProcessing` adds all BFF management endpoints and handlers for proxying `index.html`. You can also map each endpoint individually by calling the various `MapBffManagementXxxEndpoint` methods, for example `endpoints.MapBffManagementLoginEndpoint()`.
5958

6059
The following pages describe the default behavior of the management endpoints. See the [extensibility](/bff/extensibility) section for information about how to customize the behavior of the endpoints.

astro/src/content/docs/bff/fundamentals/session/management/silent-login.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,16 @@ And then in JavaScript:
4040
document.querySelector('#bff-silent-login').src = '/bff/silent-login';
4141
```
4242

43+
:::tip
44+
In BFF v4, set the iframe's src attribute to the login endpoint instead using the query parameter `prompt=none`:
45+
46+
```javascript
47+
document.querySelector('#bff-silent-login').src = '/bff/login?prompt=none';
48+
```
49+
50+
See [OIDC Prompt support](/bff/fundamentals/session/oidc-prompts.md) for additional information.
51+
:::
52+
4353
To receive the result, the application should handle the *message* event in the browser and look for the *data.isLoggedIn* property on the event object:
4454

4555
```javascript

astro/src/content/docs/bff/fundamentals/session/oidc-prompts.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,16 @@ The `prompt` parameter can be used in situations where additional security is re
4747

4848
## Silent Login Deprecation (v3 to v4)
4949

50-
When migrating from Duende BFF v3 to v4, you may notice deprecation warnings regarding the [silent login](/bff/fundamentals/session/management/silent-login.md) feature found at the user endpoint of `/silent-login`. You should discontinue use of the silent login feature and instead use the `prompt=none` parameter to achieve the same result.
51-
52-
53-
50+
When migrating from Duende BFF v3 to v4, you may notice deprecation warnings regarding the [silent login](/bff/fundamentals/session/management/silent-login.md)
51+
feature located at the management endpoint `/silent-login`.
5452

53+
To resolve the warning, update the silent login URL in your frontend applications to point to the login endpoint instead, including the `prompt=none`
54+
query parameter:
5555

56+
```diff
57+
-const silentLoginPath = '/bff/silent-login';
58+
+const silentLoginPath = '/bff/login?prompt=none';
59+
```
5660

61+
By default, BFF v4 [automatically registers the management endpoints](/bff/fundamentals/session/management/index.md). In case you opted out of the automatic registration feature,
62+
you may still need to explicitly call `app.MapBffManagementSilentLoginEndpoints()` if you are manually mapping the management endpoints.

0 commit comments

Comments
 (0)