Wrox Programmer Forums
|
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
 
Old January 21st, 2004, 05:34 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts
Default

That worked! Thanks for your help Peter.

 
Old January 21st, 2004, 05:39 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts
Default

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?

 
Old January 21st, 2004, 05:43 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

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").
 
Old January 21st, 2004, 05:52 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts
Default

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".

 
Old January 22nd, 2004, 10:16 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 996
Thanks: 2
Thanked 11 Times in 11 Posts
Send a message via Yahoo to melvik
Default

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.
 
Old April 8th, 2004, 11:31 AM
Authorized User
 
Join Date: Jan 2004
Posts: 66
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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

 
Old April 8th, 2004, 11:58 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts
Default

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.

 
Old April 8th, 2004, 01:20 PM
Authorized User
 
Join Date: Jan 2004
Posts: 66
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,

its an internet app.

Morris

 
Old April 9th, 2004, 07:10 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts
Default

You will have to use Forms Authentication and create your own roles.

 
Old April 10th, 2004, 12:03 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 996
Thanks: 2
Thanked 11 Times in 11 Posts
Send a message via Yahoo to melvik
Default

http://p2p.wrox.com/topic.asp?TOPIC_ID=3256
http://p2p.wrox.com/topic.asp?TOPIC_ID=3275


HTH.

Always:),
Hovik Melkomian.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Form Authentication aadz5 J2EE 1 November 24th, 2006 08:09 AM
Form Authentication petrons BOOK: Professional Apache Tomcat 1 October 31st, 2006 06:41 AM
Form based authentication.... avanishp General .NET 2 June 17th, 2005 03:11 AM
Form Authentication Help (IIS) [email protected] VS.NET 2002/2003 5 July 27th, 2004 02:35 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.