 |
| ASP.NET 1.1 As of 10/6/2005, this forum is locked as part of the reorganization described here: http://p2p.wrox.com/topic.asp?TOPIC_ID=35394. No posts have been deleted. Open ongoing discussions from the last week have been moved to either ASP.NET 1.0 and 1.1 Beginners http://p2p.wrox.com/asp-net-1-0-1-1-basics-60/ or ASP.NET 1.0 and 1.1 Professional. http://p2p.wrox.com/forum.asp?FORUM_ID=50. See my sticky post inside for more. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the ASP.NET 1.1 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

January 21st, 2004, 05:34 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts
|
|
That worked! Thanks for your help Peter.
|
|

January 21st, 2004, 05:39 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts
|
|
Quote:
quote:Originally posted by planoie
<sidenote>
Many people recommend not telling the user that the password is bad (explicitly or implicitly telling them that the username is good). This encourages attempts to guess the password for a known good users. Usually you'd display an error like "No valid login for the username and password combination you entered could not be found." This provides useful but not disclosing feedback.
</sidenote>
Peter
------------------------------------------------------
Work smarter, not harder.
|
even with "invalid username OR password" does that make it obvious or would "invalid credentials" be better?
|
|

January 21st, 2004, 05:43 PM
|
 |
Friend of Wrox
|
|
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
|
|
Any user would see that username and password are required for login, so tell them that both are incorrect wouldn't reveal any more than they know already. You're just telling them that they are both wrong. That way they don't know which is wrong, thereby eliminating the obvious-ness of "invalid password" (and implied "username ok").
|
|

January 21st, 2004, 05:52 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts
|
|
I had to modify it because a hacker could eventually put 2 + 2 together and see that when a valid username was entered but wrong password it displayed Invalid Username and Password. When an invalid username was entered it redirected to the register.
So, I changed both to display "invalid username and password".
|
|

January 22nd, 2004, 10:16 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 996
Thanks: 2
Thanked 11 Times in 11 Posts
|
|
I dont know if it'll help u r not! but this is the code that I use for check my users' login using SP in SQL Server 2000.
Code:
private void Buttonlogin_Click(object sender, System.EventArgs e)
{
NewBazConn.Open();
CommLogin.Parameters[1].Value = TextBoxUserName.Text;
CommLogin.Parameters[2].Value = TextBoxUserPass.Text;
CommLogin.ExecuteReader();
NewBazConn.Close();
switch( (int)CommLogin.Parameters[0].Value )
{
case 1 :
LabelError.Text = "login failed!";
break;
LabelError.Text = "User is disable!";
break;
case 7 :
FormsAuthentication.SetAuthCookie(CommLogin.Parameters["@UserID"].Value.ToString(), false);
NewBazConn.Open();
CommAccList.Parameters["@User"].Value = CommLogin.Parameters["@UserID"].Value;
CommAccList.ExecuteReader();
NewBazConn.Close();
Session.Add("UserAcc", CommAccList.Parameters["@Access"].Value.ToString() );
Session.Timeout = 30;
Response.Redirect(Request.QueryString.Get("ReturnUrl"));
break;
}//switch
}
Always:),
Hovik Melkomian.
|
|

April 8th, 2004, 11:31 AM
|
|
Authorized User
|
|
Join Date: Jan 2004
Posts: 66
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hi folks,
I was wondering if this code could be edited to create user groups such as admin etc when the user is logging in?
Do I need to create a list of groups and users elsewhere and reference them - how would I do this? Or, if the info is held in a database, do i access this and put the user into a role when they log in. How would I do this?
As I know very little about user groups etc (or anything else for that matter!) all help is greatly recieved.
Thanks,
Morris
|
|

April 8th, 2004, 11:58 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts
|
|
Are you using an Intranet app or Internet? Intranet gives you the ability to use Windows Authentication and you can check for their role against the server. With Internet, you could establish a role in a DB like you said and verify from the DB.
|
|

April 8th, 2004, 01:20 PM
|
|
Authorized User
|
|
Join Date: Jan 2004
Posts: 66
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hi,
its an internet app.
Morris
|
|

April 9th, 2004, 07:10 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts
|
|
You will have to use Forms Authentication and create your own roles.
|
|

April 10th, 2004, 12:03 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 996
Thanks: 2
Thanked 11 Times in 11 Posts
|
|
|
|
 |