RE: Remoting security error



Hi Steven,

As per your suggestion, I have Changed my code as follows.

======================================================ServerSide (unchanged
from before)

Dim props As New Dictionary(Of String, Object)
props("typeFilterLevel") = "Full"
Dim provider As BinaryServerFormatterSinkProvider = New
BinaryServerFormatterSinkProvider(props, Nothing)
props("secure") = True
props("port") = 9090
Dim tcpchan As New Tcp.TcpChannel(props, Nothing, provider)
ChannelServices.RegisterChannel(tcpchan, True)
======================================================

======================================================
ClientSide
I have taken out the binaryclientformattersinkprovider and instead pass
nothing to the TcpChannel ctor
I have added the domain to props
The user name I have changed as per your suggestion to contain only the user
name.

Dim props As New Dictionary(Of String, Object)
props("secure") = True
props("domain") = "mymachinename"
props("username") = "username"
props("password") = "mypassword"
props("port") = 0
Dim tcp As New TcpChannel(props, Nothing,Nothing)
ChannelServices.RegisterChannel(tcp, True)
=====================================================

However I am still getting the same error.
But If I comment out lines setting the domain, username and password
everything works fine locally.

Also I am not able to access your sample code. Please can you email it to
me? Do You need my email ID?

Regards Mathai

--
mathai


"Steven Cheng[MSFT]" wrote:

Hello Mathai,

From your description, I understand you're developing an .NET 2.0 remoting
application(server and client), they'll communicate through TCP channel.
Currently you're setting the channel to use secure communication, but
encountering some problem on turning on the secure channel and pass client
credentials to the server-side, correct?

Based on the code you provided and my local test, here are some points you
could check in your remoting project(client and server):

1. In your client code part, you also create a
"BinaryServerFormatterSinkProvider" for your client channel, is this a typo
or your actual code is exactly like this? If this is the case, you need to
change it to BinaryClientFormatterSinkProvider instead.

2. When using secured Tcp or HttpChannel to communicate between remoting
client and server, the client channel will automatically pass the current
security context(windows identity) of the client process to the server. And
this is the recommended means since this won't require us to provide clear
text username/password credentials in the application code.

3. If you do need to use the channel properties collection to supply the
client authentication credentials, you need to take of the following things:

props("username") can only contains username part, but not the complete
full qualified username with machine or domain name. If you want to specify
domain or machine name, you can use the "domain" property, e.g.

===============
props("domain") = "domain or machine name"
props("username") = "username"
props("password") = "Password01!"
=====================

I think the error " the server has rejected the client credentials." is
likely caused by the above setting.

Please check the above things and test the programs on a single
machine(locally ) first to see whether it works. After it works locally,
but failed when running the client on a remote machine, you can consider
the following things:

1) Whether there is any firewall on server or between server and client
machine that block the certain Tcp channel(based on tcp port). A common way
to test this is use telnet.

2) Since you're passing credentials in code, make sure that you've supplied
a valid credential which is recognizable/authenticatable on both client and
server machine.

In addition, for your convenience, I've attached a simple test solution
which include a remoting client and a server project which use secured TCP
channel to communicate. (I've include the code on specifying client
credentials in it also). You can have a look if you feel necessary, or if
you have any problems get the attachment, please feel free to let me know
and I can send you directly through mail.

Hope this helps.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead



==================================================

Get notification to my posts through email? Please refer to

http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.



Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial

response from the community or a Microsoft Support Engineer within 1
business day is

acceptable. Please note that each follow up response may take approximately
2 business days

as the support professional working with you may need further investigation
to reach the

most efficient resolution. The offering is not appropriate for situations
that require

urgent, real-time or phone-based interactions or complex project analysis
and dump analysis

issues. Issues of this nature are best handled working with a dedicated
Microsoft Support

Engineer by contacting Microsoft Customer Support Services (CSS) at

http://msdn.microsoft.com/subscriptions/support/default.aspx.

==================================================



This posting is provided "AS IS" with no warranties, and confers no rights
.



Relevant Pages

  • Re: MAC Address
    ... Note that the IP address of the client is not reliable ... MAC addresses on the computer on which the code resides, but the server ... Dim SessionID As Int32 'DWORD integer ... ByVal SessionId As Int32, ByVal WTSInfoClass As Int32, ...
    (microsoft.public.windows.terminal_services)
  • Re: Using Visual Basic NET to Access Terminal Services Session and Client Information
    ... It also accesses the Client Information for the client which executes ... this program on a Terminal Services Server. ... Dim pWinStationName As String ' integer LPTSTR - Pointer to a null-terminated string containing the name of the WinStation for this session ... ByVal SessionId As Int32, ByVal WTSInfoClass As Int32, ByRef ppBuffer As String, ByRef pCount As Int32) As Boolean ...
    (microsoft.public.windows.terminal_services)
  • Using Visual Basic NET to Access Terminal Services Session and Client Information
    ... It also accesses the Client Information for the client which executes this program on a Terminal Services Server. ... Dim pWinStationName As String ' integer LPTSTR - Pointer to a null-terminated string containing the name of the WinStation for this session ...
    (microsoft.public.windows.terminal_services)
  • Reuse of Remoting Channels...
    ... makes it possible for the server to know the identity of the caller. ... If my client is on the other side of a Windows 'realm' (as in the ... RemotingConfiguration options) to reject any clients whose credentials ... "Remoting server cannot be reached. ...
    (microsoft.public.dotnet.framework.remoting)
  • Re: SSPI Kerberos for delegation
    ... We want the authentication to happen without providing credentials ... But SSPI while authenticating from the client to the server can do mutual ...
    (comp.protocols.kerberos)