Authentication with the TCP Channel
Hi there,
I'm working with the July CTP of VS.NET and found this article:http://msdn2.microsoft.com/library/59hafwyt(en-us,vs.80).aspx
Somebody out there who tried authentication with the tcp channel?
I have a website that talks over a tcp channel to a marshal-by-ref bussiness layer object that is hosted in a windows service. I want to impersonate my users, so that I can use role-based security in the business layer object. I would really like to use the tcp channel authentication as described here, but when I do that as described in the article (setting the server side authenticationMode to ImpersonateCallers and the client impersonationLevel to Impersonate), the Identity in the remoted object stays null.
If anybody has an example for me, I would be really greatfull.
Thanx,
Bart
I have the same problem and also tried the configuration showed at the article you have posted, but it still does not works. Is it possible for you to post your server- and client-sided code regarding .net remoting security options? Are there any additional settings required to secure tcp and enable authentication?
Greetings Stefan
This is what I did on my server:
<
system.runtime.remoting>
<application>
<service>
<wellknown
mode="Singleton"
type="RemotableType.RemoteClass, RemotableType"
objectUri="RemotableType.rem" />
</service>
<channels>
<channel
ref="tcp"
port="8020"
secure="true"
impersonate="true"
protectionLevel="EncryptAndSign" />
</channels>
</application>
</system.runtime.remoting>The client has this configuration:
<system.runtime.remoting>
<application>
<client>
<wellknown
type="RemotableType.RemoteClass, RemotableType"
url="tcp://localhost:8020/RemotableType.rem" />
</client>
<channels>
<channel
ref="tcp"
secure="true"
tokenImpersonationLevel="Impersonation"
protectionLevel="EncryptAndSign" />
</channels>
</application>
</system.runtime.remoting>Hope this helps you
Beware of what you are saying here! Creating a user with the same name on a different machine does not mean this is the same user! The real username will be
MachineName\UserName, so this is different for both machines! You should use a user that is known on both machines, for instance a domain user!
Good luck!