Skip to content
This repository has been archived by the owner on May 12, 2023. It is now read-only.

Authenticate users in Apache by posting to an HTTP endpoint

License

Notifications You must be signed in to change notification settings

andornaut/apache-http-post-auth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

apache-http-post-auth

Authenticate users in Apache by posting to an HTTP endpoint.

You can configure the Apache authnz external authentication provider to pipe HTTP Basic Authentication credentials to apachehttppostauth.py, which then POSTs them to an HTTP endpoint. If the endpoint responds with anything other than a 200 (OK) status code, then the authentication request is rejected.

Apache 2.4 configuration

DefineExternalAuth apachehttppostauth pipe '/usr/local/bin/apachehttppostauth.py https://example.com/api/authenticate/'

<Location />
        AuthType Basic
        AuthName "basic"
        AuthBasicProvider external
        AuthExternal apachehttppostauth
        Require valid-user
</Location>

Settings

There are a few customizable settings:

IGNORE_SSL_ERRORS = False
IGNORE_UNEXPECTED_STATUS_CODES = False
REQUIRE_JSON_SUCCESS_STATUS_IN_RESPONSE = False
USERNAME_PARAM_NAME = 'username'
PASSWORD_PARAM_NAME = 'password

About

Authenticate users in Apache by posting to an HTTP endpoint

Topics

Resources

License

Stars

Watchers

Forks

Languages