IdentityModel恢复性概念性问题

发布于 2025-01-17 19:40:13 字数 1032 浏览 4 评论 0原文

我使用以下代码通过OIDC登录。这是一个带有Identitymodel.oidcclient 5.0.0的UWP应用程序,

LoginRequest loginRequest = new LoginRequest
{
   FrontChannelExtraParameters = new IdentityModel.Client.Parameters(parameter)
};

LoginResult result = await IdentityManager.GetOidcClient().LoginAsync(loginRequest);

因此在loginResult中,我有reforshtoken IdentityToken accessToken accessToken用于在代码中使用。我不明白的是,在令牌到期后,我得到http401,我称之为

RefreshTokenResult result = await IdentityManager.GetOidcClient().RefreshTokenAsync(
                    result.RefreshToken);

成功也将获得成功。我的问题是如何将RefreshTokenResult的值(例如refreshtoken IdentityToken AccessToken)回到loginResult? (loginResult具有内部集合属性是我无法设置的原因)

还是我做错了?我碰巧找不到具有OIDC实现的单个样本。感谢您的支持。

I use the following code to log in via OIDC. This is a UWP app with IdentityModel.OidcClient 5.0.0

LoginRequest loginRequest = new LoginRequest
{
   FrontChannelExtraParameters = new IdentityModel.Client.Parameters(parameter)
};

LoginResult result = await IdentityManager.GetOidcClient().LoginAsync(loginRequest);

So in the LoginResult, I have the RefreshToken IdentityToken AccessToken to use in the code. What I don't understand is after token expiration I get HTTP401 and I call

RefreshTokenResult result = await IdentityManager.GetOidcClient().RefreshTokenAsync(
                    result.RefreshToken);

This is also getting success. My issue is how do I get the RefreshTokenResult's values such as RefreshToken IdentityToken AccessToken back to the LoginResult? (LoginResult has internal-set properties is the reason I can't set it)

Or Am I doing this wrong? I can't happen to find a single sample with an OIDC implementation. Appreciate your support.

enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文