N
Norman Rasmussen
re: http://www.dotnet247.com/247reference/msgs/31/159270.aspx
(neither my news server, nor microsoft's seems to still carry this thread)
I am trying to add User Authentication to Cassini.
More specifically I am using Cassini as a web-server back end to a GUI
application (with a web browser control navigating the cassini web server)
and I want User.Identity to be set to the same login details as the User
running the GUI application hosting Cassini.
At the moment I have added the following lines to the web application's
global.asax.vb:
if (!User.Identity.IsAuthenticated) {
IIdentity id = new GenericIdentity(Environment.UserDomainName + @"\" +
Environment.UserName);
IPrincipal ip = new GenericPrincipal(id, new string[0]);
Context.User = ip;
}
This at least simulates the user being logged in.
I would prefer to add it to Cassini instead, because then I can host
exisiting web applications with-no-change. (This includes adding an
HTTPModule in the web.config)
I tried settings the CurrentThread.Identity in Host.Configure in Cassini,
but with no effect. Request.Process has the same problem I seem to
remember.
How is it possible to set the Context.User from the hosting thread in
Cassini?
Norman Rasmussen
open box software
T +27 21 701 7884 | M +27 (0) 83 418 9799
E (e-mail address removed) | W www.openboxsoftware.com
(neither my news server, nor microsoft's seems to still carry this thread)
I am trying to add User Authentication to Cassini.
More specifically I am using Cassini as a web-server back end to a GUI
application (with a web browser control navigating the cassini web server)
and I want User.Identity to be set to the same login details as the User
running the GUI application hosting Cassini.
At the moment I have added the following lines to the web application's
global.asax.vb:
if (!User.Identity.IsAuthenticated) {
IIdentity id = new GenericIdentity(Environment.UserDomainName + @"\" +
Environment.UserName);
IPrincipal ip = new GenericPrincipal(id, new string[0]);
Context.User = ip;
}
This at least simulates the user being logged in.
I would prefer to add it to Cassini instead, because then I can host
exisiting web applications with-no-change. (This includes adding an
HTTPModule in the web.config)
I tried settings the CurrentThread.Identity in Host.Configure in Cassini,
but with no effect. Request.Process has the same problem I seem to
remember.
How is it possible to set the Context.User from the hosting thread in
Cassini?
Norman Rasmussen
open box software
T +27 21 701 7884 | M +27 (0) 83 418 9799
E (e-mail address removed) | W www.openboxsoftware.com