Ask a Question related to ASP.NET Security, Design and Development.
-
harrismax@nospam.com #1
Putting a hole into forms authentication?
My application uses forms authentication. On the sign-in page is a form (with takes a username, a password, and has a button [SignUp]) that allows for the creation of new user accounts
I'm trying to get it so that when the SignUp (not SignIn) button is clicked, a user account is created in the database, and the forms authentication stuff is taken care of, so that I can redirect a user to another page (CustomerInfo.aspx) so they can continue filling out their account information
The problem is that I can't figure out how to get past the forms authentication mechanism so that new users get to the the other page (CustomerInfo.aspx)
private void SignUpButton_Click(object sender, System.EventArgs e
{
string SqlStatement = "INSERT INTO Customers (UserName, Password) VALUES ('" + SignUpUserName.Text.Trim() + "', '" + SignUpPassword.Text.Trim()+ "')"
SqlConnection Connection = new SqlConnection("server=*********; database=********; Trusted_Connection=SSPI")
SqlCommand Command = new SqlCommand(SqlStatement, Connection)
SqlDataReader Reader = null
Connection.Open()
Reader = Command.ExecuteReader()
while(Reader.Read()
if (Int32.Parse(Reader[0].ToString()) >= 1
SignUpError.Text = "<p><b>Signup successful.</b></p>"
SetCookie(SignUpUserName.Text.Trim(), SignUpPassword.Text.Trim(), "NEWUSR")
// can't authenticate here - I have tried several methods
Server.Transfer("CustomerInfo.aspx")
els
SignUpError.Text = "<p><b>Signup failed.</b></p>"
return
Connection.Close();
harrismax@nospam.com Guest
-
Accessing htm files without authentication (forms authentication)
I have application with forms authentication. All works fine. When user opens .aspx file gets login form, login and then get the .aspx page. But... -
ASP.Net Forms authentication with basic authentication popup
Relatively new to ASP.Net but have a strange problem. My site uses forms authentication for a large administration section however after the user... -
Forms authentication then redirection to a secure web with NT authentication?
Hi, I want to allow access to particular secured intranet web sites. These intranet are stored in sharepoint (2003 version) Actually I've... -
Authentication ticket, cookieless, forms authentication?
Hi. I want to use Forms Authentication, cookieless. The issue is setting the Authentication Ticket without using cookies (!) That is, the... -
Forms authentication with Windows authentication
Hi, I have an ASP.NET web site that uses IIS Basic Authentication and accesses an OLAP Server at various stages. The OLAP Server authentication... -
Mary Chipman #2
Re: Putting a hole into forms authentication?
You probably don't want to use that technique even if you could get it
to work, since it would leave you vulnerable to SQL injection attacks.
Here are some good resources that will help you set up forms
authentication safely:
[url]http://www.microsoft.com/downloads/release.asp?ReleaseID=44047[/url]
[url]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetsec/html/openhack.asp[/url]
-- Mary
MCW Technologies
[url]http://www.mcwtech.com[/url]
On Mon, 16 Feb 2004 15:01:08 -0800, "harrismax@nospam.com"
<anonymous@discussions.microsoft.com> wrote:
>My application uses forms authentication. On the sign-in page is a form (with takes a username, a password, and has a button [SignUp]) that allows for the creation of new user accounts.
>
>I'm trying to get it so that when the SignUp (not SignIn) button is clicked, a user account is created in the database, and the forms authentication stuff is taken care of, so that I can redirect a user to another page (CustomerInfo.aspx) so they can continue filling out their account information.
>
>The problem is that I can't figure out how to get past the forms authentication mechanism so that new users get to the the other page (CustomerInfo.aspx).
>
>private void SignUpButton_Click(object sender, System.EventArgs e)
>{
> string SqlStatement = "INSERT INTO Customers (UserName, Password) VALUES ('" + SignUpUserName.Text.Trim() + "', '" + SignUpPassword.Text.Trim()+ "')";
>
> SqlConnection Connection = new SqlConnection("server=*********; database=********; Trusted_Connection=SSPI");
> SqlCommand Command = new SqlCommand(SqlStatement, Connection);
> SqlDataReader Reader = null;
>
> Connection.Open();
> Reader = Command.ExecuteReader();
> while(Reader.Read())
> {
> if (Int32.Parse(Reader[0].ToString()) >= 1)
> {
> SignUpError.Text = "<p><b>Signup successful.</b></p>";
>
> SetCookie(SignUpUserName.Text.Trim(), SignUpPassword.Text.Trim(), "NEWUSR");
> // can't authenticate here - I have tried several methods!
> Server.Transfer("CustomerInfo.aspx");
> }
> else
> {
> SignUpError.Text = "<p><b>Signup failed.</b></p>";
> return;
> }
> }
> Connection.Close();
>}
>Mary Chipman Guest



Reply With Quote

