Regarding login control

Last post 09-06-2007 5:56 AM by Thomas Sun – MSFT. 9 replies.

Sort Posts:

  • Regarding login control

    09-04-2007, 9:58 AM
    • Loading...
    • sumajv
    • Joined on 09-04-2007, 1:27 PM
    • Posts 9

    hi all,

    in my application i have two users tables one is my own and one is aspnet_users table .i migrated all user to aspnet_users table using membership.create user function.

    i'm using login control for login purpose.

    i'm validating users in login page using membership.validateuser like this

    flag = Membership.ValidateUser(ObClsLoginDTO.UserName.ToLower(), ObClsLoginDTO.PassWord.ToLower());

    at first it is working fine without any problem.i don't know y it is not working from yesterday.

    can anybody help.it's an urgent requirement.

    thanx in advance

    regards,

    suma

     

    Filed under: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
  • Re: Regarding login control

    09-04-2007, 10:16 AM
    • Loading...
    • mod84
    • Joined on 04-02-2007, 7:30 PM
    • Posts 275

    ok i think that method only checks if the the username and pw are correct, but does not log them in. 

    have you tried FormsAuthentication.Authenticate(ObClsLoginDTO.UserName.ToLower(), ObClsLoginDTO.PassWord.ToLower())

    also if you provided a little bit more code it would be helpful, since i havent worked with the login controls that much, but have been reading up on them 

    EXPERT .NET DEVELOPER
  • Re: Regarding login control

    09-05-2007, 1:37 AM
    • Loading...
    • sumajv
    • Joined on 09-04-2007, 1:27 PM
    • Posts 9

    hi mod / All,

    mod  thanq for ur reply.

    i tried   FormsAuthentication.Authenticate that is also not working.

    in my login page i'm using login control and i have my own code for login purpose,i just used membership.validate function to check the user in aspnet tables.

    if the username and pwd matches with my own table and aspnet tables then only user can login otherwise he can't.

    i'm implimenting webparts in my application to aviod personnalization problem i used login control.

    here what i observed is when ever a user is created he is created with my applicationname what i gave in web.config

    here i'm giving that have a look

    <providers>

    <remove name="AspNetSqlMembershipProvider" />

    <add connectionStringName="LocalSqlServer" enablePasswordRetrieval="false"

    enablePasswordReset="true" requiresQuestionAndAnswer="false"

    applicationName="/IAS" requiresUniqueEmail="false" passwordFormat="Clear"

    maxInvalidPasswordAttempts="100" minRequiredPasswordLength="6"

    minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10"

    passwordStrengthRegularExpression="" name="AspNetSqlMembershipProvider"

    type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />

    </providers>

    once loging into the application through login control it is creating the same user with default application name "/ " prvided by aspnet tables.

    so it is having 2 users with same name and different applicationid and userid in aspnet_users table.

    that scenario occured before 2 days,here also i'm able to login but from last 2 days application not allowing us to login.

    flag = Membership.ValidateUser(ObClsLoginDTO.UserName.ToLower(), ObClsLoginDTO.PassWord.ToLower());

    flag2= FormsAuthentication.Authenticate(ObClsLoginDTO.UserName.ToLower(), ObClsLoginDTO.PassWord.ToLower());

    both flags are returning false.and i'm uanble to get where is the problem.

    above 2 statements i used regarding login control.remaing code is my own for login purpose.

    hope u understood.if not let me know.

    help me to overcome this.

    thanx in advance.

    Regards,

    suma.j

     

     

     

  • Re: Regarding login control

    09-05-2007, 1:42 AM
    • Loading...
    • sumajv
    • Joined on 09-04-2007, 1:27 PM
    • Posts 9

    hi mod / All,

    mod  thanq for ur reply.

    i tried   FormsAuthentication.Authenticate that is also not working.

    in my login page i'm using login control and i have my own code for login purpose,i just used membership.validate function to check the user in aspnet tables.

    if the username and pwd matches with my own table and aspnet tables then only user can login otherwise he can't.

    i'm implimenting webparts in my application to aviod personnalization problem i used login control.

    here what i observed is when ever a user is created he is created with my applicationname what i gave in web.config

    here i'm giving that have a look

    <providers> <remove name="AspNetSqlMembershipProvider" />

    <add connectionStringName="LocalSqlServer" enablePasswordRetrieval="false"

    enablePasswordReset="true" requiresQuestionAndAnswer="false"

    applicationName="/IAS" requiresUniqueEmail="false" passwordFormat="Clear"

    maxInvalidPasswordAttempts="100" minRequiredPasswordLength="6"

    minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10"

    passwordStrengthRegularExpression="" name="AspNetSqlMembershipProvider"

    type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> </providers>

    once loging into the application through login control it is creating the same user with default application name "/ " prvided by aspnet tables.

    so it is having 2 users with same name and different applicationid and userid in aspnet_users table.

    that scenario occured before 2 days,here also i'm able to login but from last 2 days application not allowing us to login.

    flag = Membership.ValidateUser(ObClsLoginDTO.UserName.ToLower(), ObClsLoginDTO.PassWord.ToLower());

    flag2= FormsAuthentication.Authenticate(ObClsLoginDTO.UserName.ToLower(), ObClsLoginDTO.PassWord.ToLower());

    both flags are returning false.and i'm uanble to get where is the problem.

    above 2 statements i used regarding login control.remaing code is my own for login purpose.

    hope u understood.if not let me know.

    help me to overcome this.

    thanx in advance.

    Regards,

    suma.j

     

     

     

  • Re: Regarding login control

    09-05-2007, 1:50 AM
    • Loading...
    • sumajv
    • Joined on 09-04-2007, 1:27 PM
    • Posts 9

    hi mod / All,

    mod  thanq for ur reply.

    i tried   FormsAuthentication.Authenticate that is also not working.

    in my login page i'm using login control and i have my own code for login purpose,i just used membership.validate function to check the user in aspnet tables.

    if the username and pwd matches with my own table and aspnet tables then only user can login otherwise he can't.

    i'm implimenting webparts in my application to aviod personnalization problem i used login control.

    here what i observed is when ever a user is created he is created with my applicationname what i gave in web.config

    here i'm giving that have a look

    <providers> <remove name="AspNetSqlMembershipProvider" />

    <add connectionStringName="LocalSqlServer" enablePasswordRetrieval="false"

    enablePasswordReset="true" requiresQuestionAndAnswer="false"

    applicationName="/IAS" requiresUniqueEmail="false" passwordFormat="Clear"

    maxInvalidPasswordAttempts="100" minRequiredPasswordLength="6"

    minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10"

    passwordStrengthRegularExpression="" name="AspNetSqlMembershipProvider"

    type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> </providers>

    once loging into the application through login control it is creating the same user with default application name "/ " prvided by aspnet tables.

    so it is having 2 users with same name and different applicationid and userid in aspnet_users table.

    that scenario occured before 2 days,here also i'm able to login but from last 2 days application not allowing us to login.

    flag = Membership.ValidateUser(ObClsLoginDTO.UserName.ToLower(), ObClsLoginDTO.PassWord.ToLower());

    flag2= FormsAuthentication.Authenticate(ObClsLoginDTO.UserName.ToLower(), ObClsLoginDTO.PassWord.ToLower());

    both flags are returning false.and i'm uanble to get where is the problem.

    above 2 statements i used regarding login control.remaing code is my own for login purpose.

    hope u understood.if not let me know.

    help me to overcome this.

    thanx in advance.

    Regards,

    suma.j

     

     

     

  • Re: Regarding login control

    09-05-2007, 1:52 AM
    • Loading...
    • sumajv
    • Joined on 09-04-2007, 1:27 PM
    • Posts 9

    hi mod / All,

    mod  thanq for ur reply.

    i tried   FormsAuthentication.Authenticate that is also not working.

    in my login page i'm using login control and i have my own code for login purpose,i just used membership.validate function to check the user in aspnet tables.

    if the username and pwd matches with my own table and aspnet tables then only user can login otherwise he can't.

    i'm implimenting webparts in my application to aviod personnalization problem i used login control.

    here what i observed is when ever a user is created he is created with my applicationname what i gave in web.config

    here i'm giving that have a look

    <providers> <remove name="AspNetSqlMembershipProvider" />

    <add connectionStringName="LocalSqlServer" enablePasswordRetrieval="false"

    enablePasswordReset="true" requiresQuestionAndAnswer="false"

    applicationName="/IAS" requiresUniqueEmail="false" passwordFormat="Clear"

    maxInvalidPasswordAttempts="100" minRequiredPasswordLength="6"

    minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10"

    passwordStrengthRegularExpression="" name="AspNetSqlMembershipProvider"

    type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> </providers>

    once loging into the application through login control it is creating the same user with default application name "/ " prvided by aspnet tables.

    so it is having 2 users with same name and different applicationid and userid in aspnet_users table.

    that scenario occured before 2 days,here also i'm able to login but from last 2 days application not allowing us to login.

    flag = Membership.ValidateUser(ObClsLoginDTO.UserName.ToLower(), ObClsLoginDTO.PassWord.ToLower());

    flag2= FormsAuthentication.Authenticate(ObClsLoginDTO.UserName.ToLower(), ObClsLoginDTO.PassWord.ToLower());

    both flags are returning false.and i'm uanble to get where is the problem.

    above 2 statements i used regarding login control.remaing code is my own for login purpose.

    hope u understood.if not let me know.

    help me to overcome this.

    thanx in advance.

    Regards,

    suma.j

     

     

     

  • Re: Regarding login control

    09-05-2007, 2:11 AM
    • Loading...
    • Nimay11
    • Joined on 09-03-2007, 10:58 PM
    • Gold Coast
    • Posts 205

    Hi,

          are you not able to validateUser() ? or not able to login ....could you elaborate on the issue with specific error.

    All the best,


     

    Love to work,
    Nimesh

    "The best way to learn is by practicing"
    Please mark the post as answer if it has helped you
  • Re: Regarding login control

    09-05-2007, 3:17 AM
    • Loading...
    • sumajv
    • Joined on 09-04-2007, 1:27 PM
    • Posts 9

    hi nimesh, 

    both tables(my own table and aspnet_users,aspnet_membership)  are having the user  information but unable to login.

     

    regards,

    suma

  • Re: Regarding login control

    09-05-2007, 3:22 AM
    • Loading...
    • sumajv
    • Joined on 09-04-2007, 1:27 PM
    • Posts 9

    hi nimesh, 

    both tables(my own table and aspnet_users,aspnet_membership)  are having the user  information but unable to login.

    it is giving messege "Invalid user id or password. Please try again. "

     

    regards,

    suma

  • Re: Regarding login control

    09-06-2007, 5:56 AM
    Answer

    Hi,

    Based on my understanding, when you want to validate the user by the Membership's ValidateUser method, it always returns false. If I have misunderstood you, please feel free to let me know.

    The ValidateUser method provides the way to verify a user name and password from the data source. The ValidateUser method returns false, which indicates that the user name or password isn't valid.

    To better understand your issue, could you please confirm the following information:

    • Please make sure that the user name and password exists in the aspnet database.
    • You said that it worked fine, but it doesn't work now. Did you do some changes?

     

    I hope this helps.

    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
Page 1 of 1 (10 items)
Microsoft Communities