在 WCF 中使用联合安全性更改用户

发布于 2024-08-26 21:13:10 字数 178 浏览 3 评论 0原文

我的任务是在使用联合安全性连接到 WCF 服务的组件中实现用户切换。

我可以使用 Tokenclaims.ReadClaim() 来找出当前登录的用户名。

如何使该令牌失效并强制再次登录?

我尝试更改凭据上的用户名和密码,但这似乎不起作用,因为现有的声明仍在使用中。

帮助 :)

I have been tasked with implementing user switching in a component that connects to a WCF service using federated security.

I can use Tokenclaims.ReadClaim() to find out what username is currently logged on.

How do I invalidate this token and force another logon?

I have tried changing the username and password on the credentials, but that doesn't seem to do the trick, as the existing claim is still being used.

help :)

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

友欢 2024-09-02 21:13:10

我建议考虑编写自定义 ClientCredentials< /code>子类。在此类中,您可以管理每次调用使用哪些令牌以及何时使用。您可以在这篇 MSDN 文章中了解有关自定义客户端凭据的更多信息。

I suggest looking into writing a custom ClientCredentials subclass. In this class you can manage what tokens are used and when for each call. You can read more about custom client credentials in this MSDN article.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文