Is this possible at all? I'm inclined to think that it's indeed possible but
not without some messing around with custom channel sinks or whatever :-)
I'm developing the administrative front-end for a website and I'd like that
application to be winforms instead of webforms. The only problem is getting
this FormsAuthentication+HttpChannel thing to work. I know I could put this
to work by using asp.net webservices and setting a CookieContainer in the
client proxy but I'd rather stick to the full type fidelity .net remoting
gives me.
Well, right now I'd be a very happy developer just by getting the following
simple scenario to work:
<snip description="server">
using System;
using System.Web;
using System.Web.Security;
namespace Research.HttpChannel
{
public class Server : MarshalByRefObject
{
public void Login(string username)
{
FormsAuthentication.SetAuthCookie(username, true);
}
public void Logout()
{
FormsAuthentication.SignOut();
}
public string ServerString
{
get
{
string username = HttpContext.Current.User.Identity.Name;
return "Hello, " + username + "!";
}
}
}
}
</snip>
<snip description="client">
using System;
using Research.HttpChannel;
public class Application
{
public static void Main(string[] args)
{
string uri = args[0];
Server server = Activator.GetObject(typeof(Server), uri) as Server;
server.Login("bamboo");
Console.WriteLine(server.ServerString);
server.Logout();
}
}
</snip>
Any chance of getting the client proxy to remember the cookie set by the
server?
Thanks in advance for any help,
Rodrigo