Sometimes you need to simulate client user on server operations, with .Net Remoting, this can be done in simple steps.
On the server side, we have to enable security communication and to set impersonate level, this can be done by adding configuration settings in application config file:
<channel ref="tcp" port="8888" secure="true" impersonate="true" authenticationMode="ImpersonateCallers"/>
- impersonate="true" to enable impersonation on threads
- authenticationMode="ImpersonateCallers" to impersonate the caller, which impersonate client user before calling remoted object's methods
- secure="true" to enable security options
On the client sider, application should comply server's rules
- secure="true" to enable client security options
- tokenImpersonationLevel="impersonation" to enable client side impersonation, this property is same with server's impersonate property
When you server starts, do enable security option in your code:
On client side application, also configure remoting service via config file with secure enabled like the above code sample.
The above sample illustrate NTLM scenario, with Kerberos, you'll have to add a property spn="Service/Domain" in your client configuration file.