Authentication

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • fayazmd
    New Member
    • Jul 2007
    • 41

    Authentication

    Hi,

    I have created a login web page with C#. I am validating the username and password successfully. After logging in welcome page is displayed. But if you are changing the url in address bar with welcome.aspx, without logging in, the welcome page is opening. It should not be opened. I think i have to change web.config authentication mode to forms. But its not working.


    Can any body send web.config code for this issue.
  • nateraaaa
    Recognized Expert Contributor
    • May 2007
    • 664

    #2
    Originally posted by fayazmd
    Hi,

    I have created a login web page with C#. I am validating the username and password successfully. After logging in welcome page is displayed. But if you are changing the url in address bar with welcome.aspx, without logging in, the welcome page is opening. It should not be opened. I think i have to change web.config authentication mode to forms. But its not working.


    Can any body send web.config code for this issue.
    You could add a session variable when a user is logged in. Then on your welcome page check to see if the session variable is != null. If it is null the user has not logged in yet. Redirect them to the login page.

    Nathan

    Comment

    • fayazmd
      New Member
      • Jul 2007
      • 41

      #3
      Originally posted by nateraaaa
      You could add a session variable when a user is logged in. Then on your welcome page check to see if the session variable is != null. If it is null the user has not logged in yet. Redirect them to the login page.

      Nathan

      Thank U, It's working. Then what is forms authentication. I did not use in my project. But I am authenticating one person.

      Can u tell me what is the significance of it and how to use forms authentication in my project.

      Comment

      • Shashi Sadasivan
        Recognized Expert Top Contributor
        • Aug 2007
        • 1435

        #4
        Originally posted by fayazmd
        Can u tell me what is the significance of it and how to use forms authentication in my project.
        Use the search engines.
        Please See this link .
        Cheers

        Comment

        • fayazmd
          New Member
          • Jul 2007
          • 41

          #5
          Originally posted by Shashi Sadasivan
          Use the search engines.
          Please See this link .
          Cheers

          Thanks. I got theory point, but i dont know how to impliment in code.

          I edited my web.config with following

          <authenticati on mode= "Forms">
          <forms name=".ASPXAUTH " loginUrl="Login .aspx" />
          </authentication>

          <authorizatio n>
          <deny users="?" />
          </authorization>

          and even though i logged in with correct username & password, it is redirecting to login page only.

          How to impliment forms authentication in my code. And how to log out of mypage.

          Comment

          • nateraaaa
            Recognized Expert Contributor
            • May 2007
            • 664

            #6
            Originally posted by fayazmd
            Thanks. I got theory point, but i dont know how to impliment in code.

            I edited my web.config with following

            <authenticati on mode= "Forms">
            <forms name=".ASPXAUTH " loginUrl="Login .aspx" />
            </authentication>

            <authorizatio n>
            <deny users="?" />
            </authorization>

            and even though i logged in with correct username & password, it is redirecting to login page only.

            How to impliment forms authentication in my code. And how to log out of mypage.
            Please see this msdn article on how to use forms based authentication.

            Nathan

            Comment

            • fayazmd
              New Member
              • Jul 2007
              • 41

              #7
              Originally posted by nateraaaa
              Please see this msdn article on how to use forms based authentication.

              Nathan

              Nice Article. I got it. Thanks.

              Comment

              Working...