Re: Forms Authentication

From: Leonard Rutkowski (LeonardRutkowski_at_discussions.microsoft.com)
Date: 01/05/05


Date: Wed, 5 Jan 2005 04:45:09 -0800

Hi Hernan,
 I read this article, and didn't really understand it. I will take another
look at it.

Thanks,
 Leonard

"Hernan de Lahitte" wrote:

> If you want to redirect your users to different virtual directories though
> different applications, you have a SSO (Single Sign On) scenario with Forms
> Authentication therefore I suggest you this post:
>
> http://weblogs.asp.net/hernandl/archive/2004/06/09/ssoformsauth.aspx
>
> Regards.
>
> Hernan de Lahitte
> http://weblogs.asp.net/hernandl
> http://www.lagash.com/english/index.html
>
> "Leonard Rutkowski" <LeonardRutkowski@discussions.microsoft.com> wrote in
> message news:57B8B42F-3B2C-4F8C-9343-890A2895F005@microsoft.com...
> > Hello all,
> > I am trying to use Forms authentication. I have got it to work
> > successfully, when the login page, and the redirect page are in the same
> > virtual directory, however, I want to put the login page into a separate
> > directory. When the user logs in, they will be directed to an
> > application,
> > that may be different for each user, and these applications will be in
> > separate virtual directories. When I try to login, the login page
> > returns.
> > This seems to indicate that the authorization is not being passed on to
> > the
> > application.
> >
> > Here is my code:
> > Dim AppLogin As New AppLogin
> > If AppLogin.LoginIsAuthorized(txtClientNo.Text, _
> > txtUsername.Text, txtPassword.Text) Then
> > 'FormsAuthentication.RedirectFromLoginPage("lrutkowski", False)
> > 'FormsAuthentication.SetAuthCookie("lrutkowski", False)
> > Dim authTicket As New FormsAuthenticationTicket(1,
> > txtUsername.Text, DateTime.Now, DateTime.Now.AddMinutes(60), False,
> > "test")
> > 'Dim authTicket As New FormsAuthenticationTicket(1,
> > "lrutkowski", DateTime.Now, DateTime.Now.AddMinutes(60), False, "test")
> > Dim encryptedTicket As String =
> > FormsAuthentication.Encrypt(authTicket)
> > Dim authCookie As New
> > HttpCookie(FormsAuthentication.FormsCookieName, encryptedTicket)
> > Response.Cookies.Add(authCookie)
> > Response.Redirect("/CustomerService/default.aspx")
> > Else
> > lblErrorMsg.Text = "Login is invalid"
> > End If
> >
> > and here is my web.config:
> >
> > <authentication mode="Forms">
> > <forms name=".gfdASPXAUTH"
> > path="/" loginUrl="/PortalLogin/PortalLogin.aspx"
> > protection="All" timeout="30"
> > requireSSL="false">
> > </forms>
> > </authentication>
> >
> > <!-- AUTHORIZATION
> > This section sets the authorization policies of the application.
> > You can allow or deny access
> > to application resources by user or role. Wildcards: "*" mean
> > everyone, "?" means anonymous
> > (unauthenticated) users.
> > -->
> > <authorization>
> > <deny users="?" />
> > <!-- <allow users="*" /> --> <!-- Allow all users -->
> > <!-- <allow users="[comma separated list of users]"
> > roles="[comma separated list of roles]"/>
> > <deny users="[comma separated list of users]"
> > roles="[comma separated list of roles]"/>
> > -->
> > </authorization>
> >
> >
> > Thanks, Leonard
> >
>
>
>



Relevant Pages

  • Re: linux to unix
    ... becuase I only can login and use my applications. ... we can migrate our clients to linux. ... I have found that several SCO Unix text mode applications ...
    (alt.os.linux)
  • Re: More than One
    ... Microsoft Online Support ... | directory can has its own virtual directory based IIS ... | there is no namespace statement in ASP.NET 2.0 applications and there is ...
    (microsoft.public.dotnet.framework.aspnet)
  • Strange Startup Slow Networking Behavior
    ... I am recently experiencing a strange problem during startup on my system. ... Login begins and Windows ... Applications such as Word 2003, Word Pad, ... occurred in safe mode with networking as well. ...
    (microsoft.public.windowsxp.help_and_support)
  • 1 login for 2 separate secure apps on the same server - is this possible?
    ... I have two secure applications that reside on the same server. ... able to login to the first application, then when I have found the ... all the necessary rights for that user. ... to make this object arrangement work between the two apps. ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: [opensuse] openSUSE 10.3 and system maintenence processes
    ... applications are doing. ... This will disable online update from running every time you ... login and stop the automaitc refresh of all repositories. ... Depending on whether you use Beagle search index, ...
    (SuSE)