+1-888-365-2779
Try Now
More in this section

Forums / Set-up & Installation / Login controls not picking up user input

Login controls not picking up user input

8 posts, 0 answered
  1. Andrew Wrigley
    Andrew Wrigley avatar
    63 posts
    Registered:
    01 Sep 2009
    07 Jun 2010
    Link to this post
    Hi

    I have spent all day merging sitefinity into an existing website.  Not fun.

    All is working except for one issue:

    ~/Sitefinity/login.aspx form is not working.  It appears as required when I request:

    mysite.com/sitefinity

    But when I input the username and password, and debug the result, it shows that:

    this.Login1.UserName == ""

    and

    this.Login1.Password == ""

    regardless of user input.  As a result, the login fails.

    If however I hard code the password and username values in ~/sitefinity/login.aspx.cs, the login proceeds as expected.

    As a result, it seems the login control is not picking up the values off the form.  No idea why, but it could be that when merging the web.config files, I have missed a setting?

    Any (other) suggestions?

    Many thanks in advance

    Andrew
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    07 Jun 2010
    Link to this post
    Hi Andrew Wrigley,

    Try adding runAllManagedModulesForAllRequests in your web.config

    <system.webServer>
            <modules runAllManagedModulesForAllRequests="true">


    If you do not get message for wrong password, most probably your request is not processed.

    Here are two links that describes the attribute

    You could try to run the project through Visual Studio Web Server to see if there is any difference in case the above does not help.

    Greetings,
    Ivan Dimitrov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  3. Andrew Wrigley
    Andrew Wrigley avatar
    63 posts
    Registered:
    01 Sep 2009
    07 Jun 2010
    Link to this post
    Ivan

    Sorry, that didn't solve the problem.  The issue is that in the following line, regardless of user input, the UserName and Password properties of this.Login1 evaluate to "":

    void Login1_Authenticate(object sender, AuthenticateEventArgs e)
    {
            e.Authenticated = UserManager.Default.ValidateUser(this.Login1.UserName, this.Login1.Password);
    }

    ie,

    this.Login1.UserName = "" and this.Login1.Password = "".  

    The request *is* processed because if I hardcode:

    e.Authenticated = UserManager.Default.ValidateUser("MyValidUserName", "MyValidPassword");

    I really can't see why the Login1.UserName and Login1.Password properties do not correctly reflect the user input.

    That is the problem.  Everything else works just fine.  Ie, hardcoding the login credentials results in a successful login to the CMS area.

    Andrew
  4. Andrew Wrigley
    Andrew Wrigley avatar
    63 posts
    Registered:
    01 Sep 2009
    07 Jun 2010
    Link to this post
    I have tried adding an asp:TextBox control to the Login.aspx page:

    In the codebehind file I put:

    void Login1_Authenticate(object sender, AuthenticateEventArgs e)
    {
            e.Authenticated = UserManager.Default.ValidateUser(this.Login1.UserName, this.Login1.Password);
            string sTest = xx.Text;
    }

    sTest correctly reflects user input, unlike this.Login1.UserName and this.Login1.Password.

    This indicates to me that there is a problem with the Login control.  For some reason, it is not picking up the user input.  I can only imagine that this is because there is a problem in the merged web.config file, but don't know.

    Thanks any help.

    Andrew

  5. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    08 Jun 2010
    Link to this post
    Hello Andrew Wrigley,

    Check whether Forms authentication is enabled. Make sure that you have the following lines in your web.config

    <authentication mode="Forms">
        <forms name=".ASPNET" loginUrl="~/sitefinity11/login.aspx" protection="All" timeout="1440" path="/" />
    </authentication>
    <authorization>
        <allow users="?" />
    </authorization>


    Regards,
    Ivan Dimitrov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  6. Andrew Wrigley
    Andrew Wrigley avatar
    63 posts
    Registered:
    01 Sep 2009
    08 Jun 2010
    Link to this post
    Ivan

    That is all there.  As I have said, it all works if I hard code the username and password into the Login1_Authenticate method.

    The only problem is that the values of Login1.UserName and Login1.Password are not being read by the code.

    I have no idea why this is happening.  It reads a textbox that I put in, but not the user input to the Login control.

    Andrew
  7. Andrew Wrigley
    Andrew Wrigley avatar
    63 posts
    Registered:
    01 Sep 2009
    08 Jun 2010
    Link to this post
    I have bypassed the login problem by hard coding login details.

    Once inside the CMS, I am having a different problem.  If I try to upload a control, I get the following error:

    An error occurred loading a configuration file:  Failed to map the path '/'.

    This hints at a configuration problem, and I wonder if the two issues are related?  Can someone help, please?

    Andrew
  8. Andrew Wrigley
    Andrew Wrigley avatar
    63 posts
    Registered:
    01 Sep 2009
    08 Jun 2010
    Link to this post
    The Upload Control error is fixed by running Visual Studio as Administrator, when running on a dev machine, ie, not full IIS.

    This doesn't fix the issue with the Login control, so they are distinct.
Register for webinar
8 posts, 0 answered