It makes sure that the given user name exists at the system
(with a UID > 1000) and that the password corresponds to
-a specific one given in this file.
+the password that is provided by the AuthExternalContext
+directive in the apache configuration.
"""
-
-# Configuration
-PASSWORD = 'hygCithOrs5'
-
-
-# ------------------------------------------------------------
-
import os
import pwd
import sys
# Get provided username and password
username = os.environ.get('USER')
password = os.environ.get('PASS')
+valid_password = os.environ.get('CONTEXT')
# We want to have a existing user ...
# ... and the password has to be as given above
-if password != PASSWORD:
+if password != valid_password:
sys.exit(1)
As an example for an non-standard authorization method, we provided the script
tdyndns_auth_simplepwd that just checks whether the user is present in the
-system and whether a certain password is given:
+system and whether a certain password is given (supplied via "AuthExternalContext"
+below):
<VirtualHost *:80>
ServerName dyndns.example.com
AuthType Basic
AuthBasicProvider external
AuthExternal tdyndnsauth
+ AuthExternalContext hygCithOrs5
AuthName "tdyndns authorization"
Require valid-user
</Directory>