views:

302

answers:

1

I have an web application that uses windows integrated security. I also have a windows service that runs as local system. The web application uses .NET remoting to execute a method on the serivce through tcpip channel. Is there a way, on .NET 2.0, to pass the windows identity to the service?

A: 

Per MSDN documentation, configure the client and server app.config files.

Server:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <system.runtime.remoting>
        <application>
            <channels>
              <channel ref="tcp" secure="true" impersonate="true" />
             </channels>
        </application>
    </system.runtime.remoting>
</configuration>

Client:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <system.runtime.remoting>
        <application>
            <channels>
              <channel ref="tcp" secure="true" tokenImpersonationLevel="impersonation"/>
             </channels>
        </application>
    </system.runtime.remoting>
</configuration>

Notice that the attribute is called impersonate for the server but tokenImpersonationLevel for the client.

See: http://msdn.microsoft.com/en-us/library/59hafwyt(VS.85).aspx

binarycoder
I found that same documenation. However, I still could not get the comm to work from the client to the server. Because of time constrictions a less... elegant solution was implementated where we directly passed the groups (roles) to the service.