pythonapachewsgiweb2py

How to get local users username from Web2Py?


I am working on a web2py app which I would like to be able to use some of the user's local variables to customize things a bit, specifically I am trying to get the user's domain and username.. I know that this is possible running on an Apache using the module "mod_auth_sspi".

Is this possible on a Rocket WSGI 1.2.6 server? Or has anybody tried doing this on a web2py app before? Is there a python module that could do this?


Solution

  • I just ended up moving the web2py app over to an Apache server. If somebody doesn't know how to do this then you can find all of the documentation here:

    http://web2py.com/book/default/chapter/13

    After that I installed the mod_auth_sspi module in order to get instructions. The x86 version of the module can be downloaded from here

    It will require an x86 installation of Apache though. After it is downloaded:

    1. Unzip the file
    2. Drag mod_auth_sspi.so from the bin folder into wherever you modules folder for your Apache installation is.
    3. Add LoadModule sspi_auth_module modules/mod_auth_sspi.so to your httpd.conf file as well as any sspi settings you need to whichever location you need to apply security to.

    I did have some issues with authentication on some browsers, but I did find solutions which you can find here:

    How can you store a log in using mod_auth_sspi on Apache?