开发者

Getting Custom UserName Credentials in a WCF Method Call

I have a WCF Service with a binding endpoint with security mode set to "TransportWithMessageCredentials" and a custom UserNamePasswordValidator to handle the credential validations. It's wor开发者_如何学Cking fine.

Since the validation is addressed outside of the service operation/method, is it possible (and if so how) to get the name of the authenticated user from inside of the method?

Thanks


Try this:

ServiceSecurityContext.Current.PrimaryIdentity.Name
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜