wcf - (WCF)如何在我的服务中获取登录客户端的用户名?

标签 wcf authentication

我有一个自定义密码验证器,它是 System.IdentityModel.Selectors.UserNamePasswordValidator 的扩展。如何从服务中获取用户名?

最佳答案

如果你只想要用户名:

OperationContext.Current.ServiceSecurityContext.PrimaryIdentity.Name

如果您需要用户名和密码,Rory Primrose 在他的文章 WCF Security: Getting the password of the user 中对此进行了解释。

关于wcf - (WCF)如何在我的服务中获取登录客户端的用户名?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8657657/

相关文章:

javascript - React中如何在函数中调用函数(auth、路由)

java - 使用Java登录基于表单的身份验证.NET Web应用程序

Java Minecraft 身份验证

wcf - 向 WCF REST 服务添加基本 HTTP 身份验证

security - OAuth2 中客户端 key 的用途是什么?

c# - 如何部署我的 3 层 wcf 服务

.net - 如何在 WCF for Exchange Web Services 中绕过 TLS/SSL 认证验证

c# - System.TimeoutException : A timeout occured after 30000ms selecting a server using CompositeServerSelector

asp.net - ajax应用的分页设计模式

c# - WCF:序列化和反序列化泛型集合