Re: FormsAuthentication - Changes in .Net Framework 1.1 ?

From: Cowboy \(Gregory A. Beamer\) (NoSpamMgbworld_at_comcast.netRemuvThis)
Date: 06/26/03


Date: Thu, 26 Jun 2003 13:11:59 -0500


I don't have time to think through what you are doing, but here is a method
that might solve.

1. Set up an auth page in each project and use forms auth on a project by
project basis
2. Set the cookie name the same across all apps that need single sign on

What we have found is the cookie name keys the forms auth in a single domain
(xxx.com). As cookies are keyed to a domain, this will only work for cookies
under a single domain name, ie you cannot authenticate mycompany.com and
myothercompany.com even if on the same server. Of course, you cannot easily
do what you are doing either across domains.

-- 
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
Author: ADO.NET and XML: ASP.NET on the Edge
****************************************************************************
****
Think Outside the Box!
****************************************************************************
****
"Pete" <schaarp@msn.com> wrote in message
news:e94Sdj9ODHA.3192@TK2MSFTNGP10.phx.gbl...
> Hello,
> i've created a ASP.net-Project with FormsAuthenication.
> The LoginUrl in web.config points to Loginpage on my separate
Login-Project.
> Using .net Framework 1.0, the Login-Mechanism an the redirect works fine.
> -If i visit the ASP.net Project i get redirected to my Login-Page
> -After successful Login a cookie ist set and i get redirected.
>
> After installing .NET-Framework 1.1 i do not get redirected from the
> Login-Page.
>
>
> What is different between in the .NET Framework 1.0 and 1.1  in this case?
>
> Code-Example:
> Project with FormsAuthentication
> <authentication mode="Forms">
>     <forms name=".nyho" loginUrl="http://localhost/genlogin/ui/login.aspx"
> protection="All" timeout="60" />
>
> </authentication>
>
> Login-Project:
> .......
> FormsAuthenticationTicket oAuthTkt;
> oAuthTkt = new FormsAuthenticationTicket(1, edtLogin.Text.ToString(),
> DateTime.Now, DateTime.Now.AddDays(8), chkPersistent.Checked,
sTktUserdata);
> sFormsCookie = FormsAuthentication.Encrypt(oAuthTkt);
> oCookie = FormsAuthentication.GetAuthCookie(edtLogin.Text,
> chkPersistent.Checked);
> oCookie.Value = sFormsCookie;
> objContext.Response.Cookies.Add(oCookie);
>
objContext.Response.Redirect(FormsAuthentication.GetRedirectUrl(edtLogin.Tex
> t, chkPersistent.Checked));
> ........
>
> Thanks for any help
>
> Pete
>
>


Relevant Pages

  • Re: FormsAuthentication cookie refreshing
    ... Without altering the forms auth model, it only extends time when a page is ... you will have to refresh an actual page. ... I am trying to refresh the cookie to make sure the timeout is reset by ... understand how XMLHTTPRequest really works at all! ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: FormsAuthentication cookie refreshing
    ... 'Without altering the forms auth model, it only extends time when a page is ... how is using xmlhttp to hit the aspx page different to using a normal ... at which point the cookie may have expired. ... you will have to refresh an actual page. ...
    (microsoft.public.dotnet.framework.aspnet)
  • get returning user for forms auth?
    ... application-specific session variables for that user. ... user again when he reenters the site; I pondered checking auth cookie ... How do I find out that authenticated user is re- ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: Setting credentials
    ... > You can add pages in the web.config that ignore the auth mode.. ... The next page he goes to will require him to logon again, ... through the normal FormsAuthentication mechanism that sets the cookie. ...
    (microsoft.public.dotnet.framework.aspnet)