Hello! I have HttpChannel (client server) and I want to authenticate users
(username and password, specified not by system, but myself). Can you help
me please? Thanks a lot
My connection codes:
Server:
IDictionary props = new Hashtable();
props["typeFilterLevel"] = "Full";
ListDictionary channelProperties = new ListDictionary();
channelProperties.Add("port", 1185);
channelProperties.Add("secure", true);
channelProperties.Add("impersonate", true);
props["useDefaultCredentials"] = false;
HttpChannel chan = new HttpChannel(channelProperties,
new SoapClientFormatterSinkProvider(),
new SoapServerFormatterSinkProvider(props, null));
m_objActSrv = (RemObj)Activator.GetObject(
typeof(RemObj),
"http://localhost:1185/WTRemoteServer");
if(ChannelServices.GetChannel(chan.ToString()) == null )
ChannelServices.RegisterChannel(chan);
RemotingConfiguration.RegisterWellKnownServiceType (
typeof(RemObj),
"WTRemoteServer", WellKnownObjectMode.Singleton);
Client:
channelProperties = new ListDictionary();
channelProperties.Add("name", string.Empty);
channelProperties.Add("port", 0);
channelProperties.Add("secure", true);
channelProperties.Add("connectionTimeout", 5000);
IDictionary props = new Hashtable();
props["typeFilterLevel"] = "Full";
props["useDefaultCredentials"] = false;
NetworkCredential credentials = new NetworkCredential("usernamevr",
"passwordpass");
HttpChannel chan = new HttpChannel(channelProperties,
new SoapClientFormatterSinkProvider(),
new SoapServerFormatterSinkProvider(props,null));
if(ChannelServices.GetChannel(chan.ToString()) == null )
ChannelServices.RegisterChannel(chan);
registedChan = chan;
string url = String.Format("http://{0}:{1}/WTRemoteServer", ip, port);
ISrvObj = (RemObj) (Activator.GetObject(typeof(RemObj), url));
ChannelServices.GetChannelSinkProperties(ISrvObj)["credentials"]=credentials
; 1 5427
Hope this helps you... http://msdn.microsoft.com/library/de...tml/remsec.asp http://www.rassoc.com/gregr/weblog/a....aspx?post=490
Regards,
--
Angel J. Hernández M.
MCP - MCAD - MCSD - MCDBA http://groups.msn.com/desarrolladoresmiranda http://www.consein.com
"teddy" <di****@email.cz> escribió en el mensaje
news:et**************@TK2MSFTNGP14.phx.gbl... Hello! I have HttpChannel (client server) and I want to authenticate users (username and password, specified not by system, but myself). Can you help me please? Thanks a lot
My connection codes: Server: IDictionary props = new Hashtable();
props["typeFilterLevel"] = "Full";
ListDictionary channelProperties = new ListDictionary();
channelProperties.Add("port", 1185);
channelProperties.Add("secure", true);
channelProperties.Add("impersonate", true);
props["useDefaultCredentials"] = false;
HttpChannel chan = new HttpChannel(channelProperties,
new SoapClientFormatterSinkProvider(),
new SoapServerFormatterSinkProvider(props, null));
m_objActSrv = (RemObj)Activator.GetObject(
typeof(RemObj),
"http://localhost:1185/WTRemoteServer");
if(ChannelServices.GetChannel(chan.ToString()) == null )
ChannelServices.RegisterChannel(chan);
RemotingConfiguration.RegisterWellKnownServiceType (
typeof(RemObj),
"WTRemoteServer", WellKnownObjectMode.Singleton); Client:
channelProperties = new ListDictionary();
channelProperties.Add("name", string.Empty);
channelProperties.Add("port", 0);
channelProperties.Add("secure", true);
channelProperties.Add("connectionTimeout", 5000);
IDictionary props = new Hashtable();
props["typeFilterLevel"] = "Full";
props["useDefaultCredentials"] = false;
NetworkCredential credentials = new NetworkCredential("usernamevr", "passwordpass");
HttpChannel chan = new HttpChannel(channelProperties,
new SoapClientFormatterSinkProvider(),
new SoapServerFormatterSinkProvider(props,null));
if(ChannelServices.GetChannel(chan.ToString()) == null )
ChannelServices.RegisterChannel(chan);
registedChan = chan;
string url = String.Format("http://{0}:{1}/WTRemoteServer", ip, port);
ISrvObj = (RemObj) (Activator.GetObject(typeof(RemObj), url));
ChannelServices.GetChannelSinkProperties(ISrvObj)["credentials"]=credentials ;
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: maxx |
last post by:
Hi,
I want use the header authentification (HTTP/PHP module), and i've a
big problem for to get the varaibles 'PHP_AUTH-*".
This is my source code :...
|
by: Jonas S. |
last post by:
Hi all,
I need some simple component (COM+ or just DLL) source to perform Basic
Authentification for ASP solution.
Short explanation what I mean:
In non secure area I've a form with fields Login...
|
by: Junky |
last post by:
Hi folks,
well, I've read some articles on authentification, but somehow I can't
get along with what I need.
I need to get the login name from the OS to check if this person is
even able to...
|
by: Ivan Demkovitch |
last post by:
Hi!
I'm reading thru everything I could find on "user Authentification" topic.
There is couple of options ASP.NET suggest: Forms, Passport, etc...
My application is simple portal with forums...
|
by: SalamElias |
last post by:
I have an application where I added the attribute requireSSL="false" in the
authentification elemnt in the dev environment and the apllication compile
with no problem. What I want to do is, In...
| |
by: bob |
last post by:
1) Authentification NT:
En ASP (pas ASP.Net),
comment on recupere le login/pwd windows ?
On veut automatiquement authentifier un utilisateur d'après son login NT (il
a pas besoin de se...
|
by: serge calderara |
last post by:
Dear all,
I clearly underdand the advantage of both type of authentification but is it
allowed or possible to set the Authentication mode to Windows and then handle
a login form for defined...
|
by: HIK |
last post by:
I am porting an ASP.net 1.1 application from a win2K server to win2k3
server. The application uses forms authentification. The
authentification information is in a query string.
The user goes...
|
by: Greg Hill |
last post by:
Hi
I'm trying to access a web server that requires authentification for a https
page. I can access http pages on that server but get "(401) Authentification
Error" for the https page. I have a...
|
by: baramuse |
last post by:
Hi all,
before starting I must say that I'm a remoting beginner so I certainly
didn't assimilate all the tricks of remoting so please be kind ;)
Now here is my interrogation:
I'm working on a...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...
| |