[Mono-list] ASP.NET Forms Authentication
Kevin Berry
kevinbe71 at yahoo.com
Sat Mar 29 14:27:15 EDT 2008
Sending this again because it failed the first time...
Sent from my iPhone
On Mar 29, 2008, at 2:07 PM, Kevin Berry <kevinbe71 at yahoo.com> wrote:
Here's my original issue... It was with forms authentication but I tried it with basic auth too. Maybe the ? vs * is throwing mono... I'll try that when I'm back on my laptop...
Sent from my iPhone
On Mar 11, 2008, at 9:55 AM, Kevin Berry <kevinbe71 at yahoo.com> wrote:
I haven't seen any replies on this yet. Is anyone using forms authentication in this way?
On Mar 7, 2008, at 11:06 PM, Kevin Berry <kevinbe71 at yahoo.com> wrote:
I can't get forms authentication to work under XSP
2.0. I'm using the following code in my login button
click event handler if the login entered is correct:
FormsAuthentication.Initialize();
String strRole = assignRoles(loginTextBox.Text);
//The AddMinutes determines how long the user will be
logged in after leaving
//the site if he doesn't log off.
FormsAuthenticationTicket fat = new
FormsAuthenticationTicket(1, loginTextBox.Text,
DateTime.Now, DateTime.Now.AddMinutes(30), false,
strRole, FormsAuthentication.FormsCookiePath);
Response.Cookies.Add(new
HttpCookie(FormsAuthentication.FormsCookieName,
FormsAuthentication.Encrypt(fat)));
Response.Redirect(FormsAuthentication.GetRedirectUrl(loginTextBox.Text,
false));
In the Web.config file I have:
<location path="Protected">
<system.web>
<authorization>
<allow roles="admin"/>
<allow roles="stduser"/>
<deny users="*"/>
</authorization>
</system.web>
</location>
<authentication mode="Forms">
<forms name="login"
loginUrl="LoginPage.aspx"
defaultUrl="Default.aspx"
protection="All"
timeout="30"
path="/"
requireSSL="false"
slidingExpiration="true"
cookieless="UseDeviceProfile"
domain=""
enableCrossAppRedirects="false"/>
</authentication>
<authorization>
<allow users="*"/>
</authorization>
This works with VS 2005 and the ASP.NET web dev
server. Why doesn't this work with Mono's XSP 2.0 web
server? Is there something I can change to make sure
this works?
NOTE: I'm using Mono 1.2.6 under Windows Vista x64 but
plan to move this to a Linux Apache web server once I
have it working on Windows. Surely this doesn't make
any difference though...
Thanks,
Kevin.
____________________________________________________________________________________
Never miss a thing. Make Yahoo your home page.
http://www.yahoo.com/r/hs
_______________________________________________
Mono-list maillist - Mono-list at lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list
____________________________________________________________________________________
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
____________________________________________________________________________________
OMG, Sweet deal for Yahoo! users/friends:Get A Month of Blockbuster Total Access, No Cost. W00t
http://tc.deals.yahoo.com/tc/blockbuster/text2.com
More information about the Mono-list
mailing list