You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: aspnetcore/blazor/security/blazor-web-app-with-oidc.md
+16-26Lines changed: 16 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -232,19 +232,6 @@ Inspect the sample app for the following features:
232
232
233
233
For more information on (web) API calls using a service abstractions in Blazor Web Apps, see <xref:blazor/call-web-api#service-abstractions-for-web-api-calls>.
234
234
235
-
:::moniker range="< aspnetcore-10.0"
236
-
237
-
<!-- UPDATE 10.0 - Check the PU issue for 10.0 work to resolve both issues.
238
-
The docs issue is https://github.com/dotnet/AspNetCore.Docs/issues/34235. -->
The custom cookie refresher (`CookieOidcRefresher.cs`) implementation might need to be updated depending on your Identity Provider. For example, the refresher expects an ID token from the token endpoint. If the refresh token isn't an ID token with claims, the refresher can be updated with additional logic to continue to use the prior set of claims stored in the authentication cookie.
243
-
244
-
Additionally, work is scheduled for .NET 10 (November, 2025) on [`BlazorWebAppOidc AddOpenIdConnect with GetClaimsFromUserInfoEndpoint = true doesn't propogate role claims to client` (`dotnet/aspnetcore` 58826)](https://github.com/dotnet/aspnetcore/issues/58826) to refresh claims from the `/userinfo` endpoint.
245
-
246
-
:::moniker-end
247
-
248
235
## Client-side Blazor Web App project (`BlazorWebAppOidc.Client`)
249
236
250
237
The `BlazorWebAppOidc.Client` project is the client-side project of the Blazor Web App.
@@ -533,19 +520,6 @@ Inspect the sample app for the following features:
533
520
534
521
For more information on (web) API calls using a service abstractions in Blazor Web Apps, see <xref:blazor/call-web-api#service-abstractions-for-web-api-calls>.
535
522
536
-
:::moniker range="< aspnetcore-10.0"
537
-
538
-
<!-- UPDATE 10.0 - Check the PU issue for 10.0 work to resolve both issues.
539
-
The docs issue is https://github.com/dotnet/AspNetCore.Docs/issues/34235. -->
The custom cookie refresher (`CookieOidcRefresher.cs`) implementation might need to be updated depending on your Identity Provider. For example, the refresher expects an ID token from the token endpoint. If the refresh token isn't an ID token with claims, the refresher can be updated with additional logic to continue to use the prior set of claims stored in the authentication cookie.
544
-
545
-
Additionally, work is scheduled for .NET 10 (November, 2025) on [`BlazorWebAppOidc AddOpenIdConnect with GetClaimsFromUserInfoEndpoint = true doesn't propogate role claims to client` (`dotnet/aspnetcore` 58826)](https://github.com/dotnet/aspnetcore/issues/58826) to refresh claims from the `/userinfo` endpoint.
546
-
547
-
:::moniker-end
548
-
549
523
## Client-side Blazor Web App project (`BlazorWebAppOidc.Client`)
550
524
551
525
The `BlazorWebAppOidc.Client` project is the client-side project of the Blazor Web App.
@@ -680,6 +654,22 @@ The important changes to the `LogInOrOut` component are demonstrated in the foll
680
654
</div>
681
655
```
682
656
657
+
:::moniker range="< aspnetcore-10.0"
658
+
659
+
## Token refresh
660
+
661
+
<!-- UPDATE 10.0 - Check the PU issue for 10.0 work to resolve both issues.
662
+
The docs issue is https://github.com/dotnet/AspNetCore.Docs/issues/34235. -->
663
+
664
+
The custom cookie refresher (`CookieOidcRefresher.cs`) implementation updates the user's claims automatically when they expire. The current implementation expects to receive an ID token from the token endpoint in exchange for the refresh token. This ID token is then used to overwrite the user's claims.
665
+
666
+
The sample implementation doesn't include code for requesting claims from the `/userinfo` endpoint on token refresh. For more information, see [`BlazorWebAppOidc AddOpenIdConnect with GetClaimsFromUserInfoEndpoint = true doesn't propogate role claims to client` (`dotnet/aspnetcore` 58826)](https://github.com/dotnet/aspnetcore/issues/58826#issuecomment-2492738142).
667
+
668
+
> [!NOTE]
669
+
> Some identity providers only return an access token when using a [refresh token](https://openid.net/specs/openid-connect-core-1_0.html#RefreshTokenResponse). The `CookieOidcRefresher` can be updated with additional logic to continue to use the prior set of claims stored in the authentication cookie.
670
+
671
+
:::moniker-end
672
+
683
673
## Cryptographic nonce
684
674
685
675
A *nonce* is a string value that associates a client's session with an ID token to mitigate [replay attacks](https://developer.mozilla.org/docs/Glossary/Replay_attack).
0 commit comments