Skip to content

Commit 6ae701a

Browse files
authored
Add CookieOidcRefresher section (#34315)
1 parent f397abd commit 6ae701a

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -654,6 +654,22 @@ The important changes to the `LogInOrOut` component are demonstrated in the foll
654654
</div>
655655
```
656656

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. The claims in this ID token are then used to overwrite the user's claims.
665+
666+
The sample implementation doesn't include code for requesting claims from the [UserInfo endpoint](https://openid.net/specs/openid-connect-core-1_0.html#UserInfo) 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 or use the access token to request claims from the UserInfo endpoint.
670+
671+
:::moniker-end
672+
657673
## Cryptographic nonce
658674

659675
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

Comments
 (0)