This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Webserver Protection Reverse Authentication Forms Error handling.

My form works great for authenticating users, this issue if someone types an incorrect username and password there is no error output.  I followed this KB: https://community.sophos.com/kb/en-us/118958 but that does not work. getValidationError() doesnt seem to be working.  Has anyone got this to work?

 

Even the default form built into Webserver protection has no error output for bad password.  Any suggestions or same code that someone has gotten this to work?

 

My code(these forms don't have an option to post formatted code?)  The as:

<!DOCTYPE html>
<html >
<head>
<linkrel="icon"href="<?assets_path?>favicon.ico">
    <!--[if IE]><link rel="shortcut icon" href="favicon.ico"><![endif]-->
<metacharset="UTF-8">
<title>g2g Partners Login</title>
<linkrel="stylesheet"href="<?assets_path?>/style.css">
</head>

<body>
<divclass="login-page">
<imgsrc="<?assets_path?>/g2glogo.gif"alt="" />
<divclass="form">
<formmethod="post"action="<?login_path?>">
<inputname="httpd_username"type="text"placeholder="username">
<inputname="httpd_password"type="password"placeholder="password">
<divid="error"style="color: red; font-weight: bold"></div>
<buttontype="submit"value="Login">Login</button>
</div>
 
</div>
</div>
<div class="myfooter">
<img src="<?assets_path?>/botompic.png" alt="Logo" />
</div>
<script type="text/javascript">
      var messages = {
        TermsNotAccepted: "You haven't accepted the terms of use.",
        InvalidLogin: "Credentials are not valid.",
        OvverrideNotAllowed: "User is not allowed to override this policy.",
        ReasonNotSpecified: "A reason for the override was not entered."
      };

      var errorCode = getValidationError();
      
      if (errorCode != "None") {
        document.getElementById("error").innerHTML = messages[errorCode];
      }
    </script>
</body>
</html>

 

 

 

 



This thread was automatically locked due to age.
Parents
  • Yes, this is an ugly glitch, but I don't know of any workaround.

    I modified my WAF login page to include a notice about the strange behavior.   I also use three prompts instead of 2, for sites that require OTP.

    A bit of javascript moves the data from my three firlds to the Sophos fields which I made hidden.

    Unfortunately, the user portal page is not modifiable

Reply
  • Yes, this is an ugly glitch, but I don't know of any workaround.

    I modified my WAF login page to include a notice about the strange behavior.   I also use three prompts instead of 2, for sites that require OTP.

    A bit of javascript moves the data from my three firlds to the Sophos fields which I made hidden.

    Unfortunately, the user portal page is not modifiable

Children
No Data