views:

110

answers:

1

I have working wsgi authentication on another server, however a second server is not accepting the same configuration and errors upon reload with the message:

Syntax error on line 12 of /etc/apache2/sites-enabled/mydomain.com
Unknown Authn provider: wsgi
    ... fail

Here is the relevant portion of the config file (line 12 is WSGIAuthUserScript ...)

<Location /adirectory/>
    AuthType Basic
    AuthName "Answer me these questions two"
    AuthBasicProvider wsgi
    WSGIAuthUserScript /home/auser/domains/mydomain.com/apache/auth_test.wsgi
    Require valid-user
</location>

WSGIPassAuthorization On

And the auth_test.wsgi file:

def check_password(environ, user, password):

    if user == 'someusername':
        if password == 'asecretpassword':
            return True
        return False

    return None

mod-wsgi.conf and mod-wsgi.load are both enabled. Of course there must be /something/ different, but I am at a loss.

+1  A: 

It turned out to be a wsgi version difference.

Nagyman
Can you elaborate. Do you mean you were still using mod_wsgi 1.X and that it was because only mod_wsgi 2.0 or later supports WSGIAuthUserScript? Even so, Apache should have complained about WSGIAuthUserScript not being supported unless the order of parsing meant that AuthBasicProvider gave an error first because of not being able to find an authentication provider registered under 'wsgi'.
Graham Dumpleton