passing user name info to protected page

Discussion in 'ASP .Net Security' started by jason@cyberpine.com, Oct 3, 2003.

  1. Guest

    Hello.

    Newbie question I'm sure.

    I've got this page I am securing with a password using a simple
    LOGIN.ASPX page:

    <%@ Page Language="VB" %>
    <script language="VB" runat="server">

    Sub btnLogin_OnClick(Src As Object, E As EventArgs)
    If txtUsername.Text = "passwordhere"
    FormsAuthentication.RedirectFromLoginPage(txtUsername.Text, True)
    Else
    lblInvalid.Text = "Sorry... try again..."
    End If
    End Sub

    </script>

    .... more html here

    and the WEB.CONFIG PAGE:

    <configuration>
    <system.web>
    <customErrors mode="Off"/>
    <authentication mode="Forms">
    <forms name="FNAME" loginUrl="login.aspx" />
    </authentication>

    </system.web>
    <location path="protectedpage.aspx">
    <system.web>
    <authorization>
    <deny users="?" />
    </authorization>
    </system.web>
    </location>

    </configuration>
    ==

    Nothing too fancy ... I'd like a few more users and then pass the
    protected page a session variable (maybe) with the valid username.

    How would/could I do this?

    Many thanks for any info or help.
     
    , Oct 3, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Andreas Klemt
    Replies:
    2
    Views:
    560
    Andreas Klemt
    Jul 5, 2003
  2. nalbayo
    Replies:
    2
    Views:
    5,508
    Bruce Barker
    Nov 11, 2005
  3. Shary
    Replies:
    3
    Views:
    445
    Nicole Calinoiu
    Dec 14, 2004
  4. Antonio O''Neal

    user.identity.name returns old AD user name

    Antonio O''Neal, Oct 31, 2008, in forum: ASP .Net Security
    Replies:
    5
    Views:
    2,077
    Antonio O''Neal
    Nov 3, 2008
  5. Renie83
    Replies:
    2
    Views:
    234
Loading...

Share This Page