Skip to content

Commit 63f4301

Browse files
authored
Update client section auth state provider remark (#33914)
1 parent 203947a commit 63f4301

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

aspnetcore/blazor/security/blazor-web-app-with-oidc.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,8 +234,18 @@ For more information on (web) API calls using a service abstractions in Blazor W
234234

235235
The `BlazorWebAppOidc.Client` project is the client-side project of the Blazor Web App.
236236

237+
:::moniker range=">= aspnetcore-9.0"
238+
239+
The client calls `AddAuthenticationStateDeserialization` to deserialize and use the authentication state passed by the server. The authentication state is fixed for the lifetime of the WebAssembly application.
240+
241+
:::moniker-end
242+
243+
:::moniker range="< aspnetcore-9.0"
244+
237245
The `PersistentAuthenticationStateProvider` class (`PersistentAuthenticationStateProvider.cs`) is a client-side <xref:Microsoft.AspNetCore.Components.Authorization.AuthenticationStateProvider> that determines the user's authentication state by looking for data persisted in the page when it was rendered on the server. The authentication state is fixed for the lifetime of the WebAssembly application.
238246

247+
:::moniker-end
248+
239249
If the user needs to log in or out, a full page reload is required.
240250

241251
The sample app only provides a user name and email for display purposes. It doesn't include tokens that authenticate to the server when making subsequent requests, which works separately using a cookie that's included on <xref:System.Net.Http.HttpClient> requests to the server.
@@ -506,8 +516,18 @@ For more information on (web) API calls using a service abstractions in Blazor W
506516

507517
The `BlazorWebAppOidc.Client` project is the client-side project of the Blazor Web App.
508518

519+
:::moniker range=">= aspnetcore-9.0"
520+
521+
The client calls `AddAuthenticationStateDeserialization` to deserialize and use the authentication state passed by the server. The authentication state is fixed for the lifetime of the WebAssembly application.
522+
523+
:::moniker-end
524+
525+
:::moniker range="< aspnetcore-9.0"
526+
509527
The `PersistentAuthenticationStateProvider` class (`PersistentAuthenticationStateProvider.cs`) is a client-side <xref:Microsoft.AspNetCore.Components.Authorization.AuthenticationStateProvider> that determines the user's authentication state by looking for data persisted in the page when it was rendered on the server. The authentication state is fixed for the lifetime of the WebAssembly application.
510528

529+
:::moniker-end
530+
511531
If the user needs to log in or out, a full page reload is required.
512532

513533
The sample app only provides a user name and email for display purposes. It doesn't include tokens that authenticate to the server when making subsequent requests, which works separately using a cookie that's included on <xref:System.Net.Http.HttpClient> requests to the server.

0 commit comments

Comments
 (0)