[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.remoting

Connect to the remoute IIS-server through the firewall.

beetle

8/5/2004 7:45:00 AM

Connect to the remoute IIS-server through the firewall.

The client windows program through HttpChannel calls SingleCall Object on
the remoted IIS-server through the firewall. On the client side remoting
infrastructure is built by config-file. I have got the exception â??(407) Proxy
Autentication Requred�

In the Msdn the reference â??Hosting Remote Objects in Internet Information
Services (IIS)� say :
Authentication in IIS-hosted Remoting Applications
The following table describes the configuration settings that enable certain
types of authentication behavior in .NET remoting when hosting your service
in Internet Information Services (IIS).

Desired behavior
The server authenticates the client on each call using the client's default
credentials.

Configuration settings
On the server, select Integrated Windows Authentication and clear Anonymous
access in IIS. On the client, set the credentials to use
CredentialCache.DefaultCredentials.

Comments
This is the default behavior in version 1.0 of the .NET Framework when
useDefaultCredentials is true. This behavior is supported in version 1.1 of
the .NET Framework if useAuthenticatedConnectionSharing is also set to false.

Desired behavior
The server authenticates the client once using the client's default
credentials; subsequent calls from this client use the previously
authenticated connection.

Configuration settings
On the server, select Integrated Windows Authentication and clear Anonymous
access in IIS. On the client, set useDefaultCredentials to true.

Comments
This behavior is supported only in the .NET Framework version 1.1 or later.

Desired behavior
The server authenticates the client once using custom or explicit client
credentials; subsequent calls from this client use the previously
authenticated connection.

Configuration settings
On the server, select Integrated Windows Authentication and clear Anonymous
access in IIS. On the client, either set the credentials to an ICredentials
implementation, or set the username, password, and domain to explicit values.
In either case, you must also set unsafeAuthenticatedConnectionSharing to
true and provide a connectionGroupName value that maps to only one
authenticated user.

Comments
This behavior is supported only in the .NET Framework version 1.1 or later.

Also the System.Runtime.Remoting.Channels.Http have got some parameters for
config file:

credentials
Gets or sets an ICredential implementation that represents the identity of
the client.

useAuthenticatedConnectionSharing
A Boolean value directing the server channel to reuse authenticated
connections rather than authenticate each incoming call. By default, this
value is set to true if the useDefaultCredentials value is also set to true;
otherwise, the value is set to false, which means that each call will be
authenticated if the server requires authentication. This also applies to the
programmatic equivalent, which is achieved either by creating an object that
implements IDictionary, setting the "credentials" value to
CredentialCache.DefaultCredentials, and passing that value to the channel
sink, or by using the IDictionary returned from the
Services.GetChannelSinkProperties method. This name/value pair is supported
only by version 1.1 of the .NET Framework on the following platforms: Windows
98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home
Edition, Windows XP Professional, Windows Server 2003 family.

unsafeAuthenticatedConnectionSharing
A Boolean value indicating that the client will supply its own credentials
and connection group name that the server should use to create an
authenticated connection group. If this value is set to true, the
connectionGroupName value must map to only one authenticated user. This
name/value pair is ignored if the useAuthenticatedConnectionSharing value is
set to true. This name/value pair is supported only by version 1.1 of the
..NET Framework on the following platforms: Windows 98, Windows NT 4.0,
Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP
Professional, Windows Server 2003 family.

connectionGroupName
The name that will be used as the connection group name on the server if the
unsafeAuthenticatedConnectionSharing value is also specified. This name/value
pair is ignored if unsafeAuthenticatedConnectionSharing is not set to true.
If specified, make sure that this name maps to only one authenticated user.
On Windows 98 and Windows Millennium Edition, there is no security ID to
identify the authentication connection group name. On these platforms,
therefore, there is one connection group name.If you want your application to
pass an implementation of ICredentials or explicit username, password, and
domain values in the HttpClientChannel properties, you can enable
authentication connection sharing by also passing the
unsafeAuthenticatedConnectionSharing name/value pair and the
connectionGroupName name/value pair, making sure that the connectionGroupName
value maps to only one authenticated user.This name/value pair is supported
only by version 1.1 of the .NET Framework on the following platforms: Windows
98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home
Edition, Windows XP Professional, Windows Server 2003 family.

It has had some questions :
What can it to set in the config-file in the â??channel-sectionâ? the
â??credentialsâ?-parameter as «ICredential implementation that represents the
identity of the clientâ? or â??CredentialCache.DefaultCredentialsâ? or
â??CredentialCacheâ? supported â??the basic, digest, negotiate, NTLM, and Kerberos
authentication methods�.

If I have to write in the config-file parameters
username, password, and domain values in the â??<Channel>â?-section
which view does the â??<Channel>â?-section have ?

Which value does the â??connectionGroupNameâ?-parameter have ?

The <channel>-section has â??useDefaultCredentialsâ?.
What does it mean ?

For the piece of code
using System.Runtime.Remoting.Channels ;
using System.Runtime.Remoting.Channels.Http ;
RemotingConfiguration.Configure(â??config-file nameâ?);
foreach (IChannel Ich in ChannelServices.RegisteredChannels){}

Under the debuger I see the Ich-contents. It has got the private class
_clentChannel.
This class has got the two private classes : _proxyObject and ProxyObject as
WebProxy-type with the indentically contents, each with
â??credentialsâ?-property with the â??undefinedâ?-value.
Both classes have got also properties :
UseAuthenticatedConnectionSharing
UseDefaultCredentials

If it is to write in the config-file in the <channel>-section
useDefaultCredentials=�true�,
then in the _proxyObject and ProxyObject classes use DefaultCredentials is
going to â??trueâ?, but nothing is changed and I have got the same : (407) Proxy
Authentication required

I set
System.Net.GlobalProxySelection.Select =
System.Net.GlobalProxySelection.GetEmptyWebProxy() ;
before
RemotingConfiguration.Configure(â??config-file nameâ?);
Or
System.Net.GlobalProxySelection.Select = System.Net.GlobalProxySelection.
CredentialCache.DefaultCredentials ;
GlobalProxy.credentials contents after that the appropriated value but
The result is the same : (407) Proxy Authentication required

My config file

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.runtime.remoting>
<application>
<lifetime
leaseTime="5M"
sponsorshipTimeOut="5M"
renewOnCallTime="5M"
leaseManagerPollTime="60S"
/>
<client>
<wellknown mode="SingleCall"
type="RemoteSpace1.RemoteCls1, RemoteCls1"

url="http://www.somewhere.ru/JobWebService/RemoteCls1...
/>
</client>
<channels>
<channel ref="http" timeout="240000"
useDefaultCredentials=�true�
>
<clientProviders>
<formatter ref="binary" />
</clientProviders>
<serverProviders>
<formatter ref="binary" />
</serverProviders>
</channel>
</channels>
</application>
</system.runtime.remoting>
</configuration>


1 Answer

Sunny

8/5/2004 1:59:00 PM

0

Hi,

In article <14D593EF-45F8-4953-A9A9-9DC2CC2C4C87@microsoft.com>,
beetle@discussions.microsoft.com says...
<snip>

This is a know problem with http channels. You can not set proxy
username/password with them. You have to play with reflection to set the
proxy user/pass. There was a good article by Chris Taylor on
dotnetjunkies, but it seems the site is down. I have found a google
cache for the article. see if it can help you:

http://64.233.167.1...
q=cache:JBHhcqga35AJ:dotnetjunkies.com/WebLog/chris.taylor/archive/2004/
01/24/6050.aspx+&hl=en

Sunny