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
精彩评论