Re: Forms Authentication
From: Leonard Rutkowski (LeonardRutkowski_at_discussions.microsoft.com)
Date: 01/05/05
- Next message: Hernan de Lahitte: "Re: Forms Authentication"
- Previous message: Hernan de Lahitte: "Re: Forms Authentication"
- In reply to: Hernan de Lahitte: "Re: Forms Authentication"
- Next in thread: Hernan de Lahitte: "Re: Forms Authentication"
- Reply: Hernan de Lahitte: "Re: Forms Authentication"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
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
> >
>
>
>
- Next message: Hernan de Lahitte: "Re: Forms Authentication"
- Previous message: Hernan de Lahitte: "Re: Forms Authentication"
- In reply to: Hernan de Lahitte: "Re: Forms Authentication"
- Next in thread: Hernan de Lahitte: "Re: Forms Authentication"
- Reply: Hernan de Lahitte: "Re: Forms Authentication"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|