开发者

Getting Custom UserName Credentials in a WCF Method Call

开发者 https://www.devze.com 2023-01-18 20:13 出处:网络
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开发者_如

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

精彩评论

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