.net - NLog: Log the user who called the application in a WCF application in IIS -
i have following scenario:
a deployed wcf service running windows hosted service. wcf service used log specific events database (nlog v2). service uses basichttpbinding.
a deployed web application (different server) under iis. application pool runs under network service credentials. web application authentication windows-integrated (active directory credentials).
whenever call wcf console application can user identity system.threading.thread.currentprincipal.identity.name
; when call web application expect "domain\server$"
thread identity name (which occurs expected).
my problem is: i'd user called web application. i've tried set aspnetcompatibilityrequirements
attribute in wcf service contract, ${asp-application}
, ${aspnet-user-identity}
, ${asp-request}
parameters in nlog read null
. httpcontext
in web application ok, not being sent wcf. there's credentials
property in nlog.logger
class, it's read-only.
does know how solve it?
probably, need set impersonatecallerforalloperations attribute
see msdn details: http://msdn.microsoft.com/en-us/library/ms731306.aspx
Comments
Post a Comment