Windows doesn't have daemon mode and it wouldn't really help in this case even 
on Linux.

In some cases for database on UNIX, if daemon mode runs as a special user then 
it can be granted access to a database without a password through local UNIX 
socket access, but that is the user of the whole process and not the specific 
user who may have logged in to your web application over the Internet.

Under windows their may be a way of doing this sort of thing through some sort 
of SSO module for Apache, if the session key can be used within the Python 
application, but I have no knowledge about all that Windows stuff so am 
guessing.

Graham

On 21/08/2014, at 1:30 AM, Bill Freeman <[email protected]> wrote:

> I'm not sure if this transfers to Windows, but for Apache started as root 
> (Administrative user?), and mod_wsgi running with daemon processes, it is 
> possible to specify as what user and group (group may not be relevant on 
> Windows) the daemon processes run.
> 
> But it is also unusual to have to be running as a particular user in order to 
> connect to a database.  Generally a database user (distinct from operating 
> system user) is created and granted suitable privileges on the desired 
> database.  The database user name and password are included in the database 
> configuration section of the django settings file.
> 
> 
> On Wed, Aug 20, 2014 at 2:23 AM, Mario Doehring <[email protected]> wrote:
> Hi,
> 
> I don't know if this is the right place for my problem, so I'm sorry if 
> not...I'm new in Apache and Python and google now for two weeks but could't 
> find a solution for my problem, so hopefully you have some ideas...
> 
> I'm using Apache 2.2 64bit on Windows 7  with WSGI 3.5 and SSPI 1.0.4., 
> Python 2.7 and Flask
> In the httpd.conf I use this configuration:
> 
> WSGIScriptAlias /vedo "d:/Apache2/htdocs/tools/vedo/app.wsgi"
> WSGIPassAuthorization On
> 
> <Directory "d:/Apache2/htdocs/tools/vedo">
>     Order allow,deny
>     Allow from all
>  </Directory>
> 
> The application is working fine except one problem:
> I need to work in the context of the user who starts the request to logon to 
> my SQL-Server within my windows domain.
> 
> I get the remote_user using: 
> 
>          request.environ.get('REMOTE_USER')
> 
> But the logon to the SQL-Server is always made by the user who starts the 
> apache service.
> Here's a example I used to logon a certain user from our microsoft domain 
> withing my application:
> 
>     hObj = win32security.LogonUser("user", "domain", "password", 
> win32con.LOGON32_LOGON_INTERACTIVE, win32con.LOGON32_PROVIDER_DEFAULT)
>     win32security.ImpersonateLoggedOnUser(hObj)
> 
> The question is, how or where can I get the handle for the remote_user 
> because I don't have the password for this users???
> Is it possible to do this generally?
> 
> I'm thankful for any help
> 
> Mario
> 
> 
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "modwsgi" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/modwsgi.
> For more options, visit https://groups.google.com/d/optout.
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "modwsgi" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/modwsgi.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"modwsgi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/modwsgi.
For more options, visit https://groups.google.com/d/optout.

Reply via email to