Search code examples
google-search-appliance

GSA Cookie Auth - "Login form doesn't have both text and password inputs"


I can't seem to find out what's wrong with the login form I'm using to setup cookie authentication, the GSA throws me this error (serving log) after submitting my credentials in universal login form:

Got form; name=customlogin clientLogin; action=/content/marketing/en/login/j_security_check; type=hidden, name=resource; type=hidden, name=_charset_; type=hidden, name=j_username; type=hidden, name=j_password
Login form doesn't have both text and password inputs
Error in authentication module: Login form doesn't have both text and password inputs

Here is the form I'm using:

<form method="POST" action="/content/marketing/en/login/j_security_check" id="form_customlogin" name="customlogin clientLogin" enctype="multipart/form-data" onsubmit="return cq5forms_validate_customlogin();">
                    <input type="hidden" name="resource" value="/content/operations/apps/en.html" />
                    <input type="hidden" name="_charset_" value="UTF-8" />
                    <input id="username" type="hidden" name="j_username" value="anonymous-user" />
                    <input id="password" type="hidden" name="j_password" value="anon" />
                    <p>
                      Or go straight through as a 
                      <a href="#" onclick="$('#form_customlogin').submit();">guest</a>
                       (limited access)
                    </p>
</form>

Does anyone have knowledge on how a form has to be built in order for the GSA to use it? It'd be very welcome.

Thanks in advance!

EDIT: Apparently, inputfilds user/pw must have type username and password, they can't be hidden. This was already a feature request.


Solution

  • The username field will have to be type="text", there is no type="username". Out of curiosity, why would you have them hidden?

    Very often, when you have complicated login forms, your best bet is to create a separate login form just for the GSA that doesn't include any JavaScript or other wackiness.