Apache form authentication issues

Posted by rfcoder89 on Server Fault See other posts from Server Fault or by rfcoder89
Published on 2014-06-06T14:18:05Z Indexed on 2014/06/06 15:28 UTC
Read the original article Hit count: 157

Filed under:
|
|

I am trying to authenticate users through Apache using the form authentication method to restrict https requests to a certain folder. Although, regardless of whether the correct login details are provided it keeps reloading the same page except the url has the form values embedded in it instead of redirecting to the appropriate page. I need to use the form authentication type instead of basic so I can write my own html for the user to login. I am using Apache 2.4.9 and this is our current configuration. Apache config file

<Location C:/wamp/www/directory>
    SetHandler form-login-handler
    AuthFormLoginRequiredLocation https://localNetwork.com/username/TestBed/HTML/login.html
    AuthFormLoginSuccessLocation https://localNetwork.com/username/TestBed/HTML/test.html
    AuthFormProvider file
    AuthUserFile "C:/wamp/passwords"
    AuthType form
    AuthName realm
    Session On
    SessionCookieName session path=/
    SessionCryptoPassphrase secret
</Location>

And in the login html page I've added that for the user to login

<form method="POST" action="/test.html">
        User: <input type="text" name="httpd_username" value="" />
        Pass: <input type="password" name="httpd_password" value="" />
        <input type="submit" name="login" value="Login" />
</form>

© Server Fault or respective owner

Related posts about https

Related posts about apache-2.4