Forms autentication and registration page - some advices

Ask a Question related to ASP.NET Security, Design and Development.

  1. #1

    Default Forms autentication and registration page - some advices

    Hi,

    I implement forms authentication in my application.
    So I have a login form.
    Actually I have two custom Web controls, one to login and one to redirect
    user to Register page

    Login custom control perform some client-side validation if username or
    password are empty

    I have two problems:

    1. Even if user click on register button (which is on Register user
    control), my page performs client side validation for username and password
    from Login user control. How can I prevent this? I can disable client-side
    validation, but I don't want this.

    2. Usually I shouldn't be able to access register page, since I'm not
    authenticated.
    So I "trick" the application, and I authenticate with a "dummy" user name,
    with a code as below, in cmdRegister_click:
    FormsAuthentication.SetAuthCookie("guest", False)

    Response.Redirect("register.aspx")

    Also, I created a custom header control I place on every page, which check
    in page_load if current user is guest and page is <> register.aspx, and in
    this case calls signoff, to avoid user to access a protected page by typing
    its name in address bar after loading Register.aspx.

    Is this solution safe enough? Can anyone suggest any better approach?

    Thank you.


    NWx Guest

  2. Similar Questions and Discussions

    1. Creating a Login / Registration Page
      Can someone please direct me to an article, website or any other data which will help me with this topic: I have a family website and my wife...
    2. code for basic registration to secure page
      hello there I know that this already exists, I just need to find the snippet or formated codes and where they are located. thanks
    3. PHP/MySQL Registration Page
      I have created a registration page that checks for a unique username before submitting the users info. If a username is found an error it thrown,...
    4. Registration page into database
      Hi all, Im doing a registration page for site visitors but I cant connect the registration page and the databse. I have a primary key in the...
    5. Registration Page
      Hi all, Im doing a registration page for site visitors but I cant connect the registration page and the databse. I have a primary key in the...
  3. #2

    Default Re: Forms autentication and registration page - some advices

    > 1. Even if user click on register button (which is on Register user
    > control), my page performs client side validation for username and
    password
    > from Login user control. How can I prevent this? I can disable client-side
    > validation, but I don't want this.
    You can set "CausesValidation" for register button to false,so it wont do
    validation.
    > 2. Usually I shouldn't be able to access register page, since I'm not
    > authenticated.
    > So I "trick" the application, and I authenticate with a "dummy" user name,
    > with a code as below, in cmdRegister_click:
    > FormsAuthentication.SetAuthCookie("guest", False)
    You can set authorization setting for particular file using location tag,
    for this file alone give
    access to all the user for all other file deny access to unauthenticated
    user. For example to set
    authorization permission for particular page,
    <location path="<filename>">
    <system.web>
    <autorization>
    <allow users="*">
    </autorization>
    </system.web>
    </location>

    --
    Saravana
    Microsoft MVP - ASP.NET
    [url]www.extremeexperts.com[/url]



    "NWx" <test@test.com> wrote in message
    news:uH8Yfgd8DHA.360@TK2MSFTNGP12.phx.gbl...
    > Hi,
    >
    > I implement forms authentication in my application.
    > So I have a login form.
    > Actually I have two custom Web controls, one to login and one to redirect
    > user to Register page
    >
    > Login custom control perform some client-side validation if username or
    > password are empty
    >
    > I have two problems:
    >
    > 1. Even if user click on register button (which is on Register user
    > control), my page performs client side validation for username and
    password
    > from Login user control. How can I prevent this? I can disable client-side
    > validation, but I don't want this.
    >
    > 2. Usually I shouldn't be able to access register page, since I'm not
    > authenticated.
    > So I "trick" the application, and I authenticate with a "dummy" user name,
    > with a code as below, in cmdRegister_click:
    > FormsAuthentication.SetAuthCookie("guest", False)
    >
    > Response.Redirect("register.aspx")
    >
    > Also, I created a custom header control I place on every page, which check
    > in page_load if current user is guest and page is <> register.aspx, and in
    > this case calls signoff, to avoid user to access a protected page by
    typing
    > its name in address bar after loading Register.aspx.
    >
    > Is this solution safe enough? Can anyone suggest any better approach?
    >
    > Thank you.
    >
    >

    Saravana [MVP] Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139