Python code running as Anonymous user?

9 views
Skip to first unread message

pyPax

unread,
Nov 10, 2010, 12:14:43 PM11/10/10
to isapi_wsgi-dev
Hi folks,

I am running a Django site with isapi_wsgi under both IIS6 and IIS7.5.
Both are using either django-mssql and/or django-pyodbc. Both
libraries cannot connect to the database with Windows authenticated,
as apparently the code is run by an Anonymous user.

I have set the Application pool to run under the User with SQL Server
access, but it doesn't seem to be making a difference.

Any help? Thanks in advance.

Mark Hammond

unread,
Nov 11, 2010, 5:25:34 PM11/11/10
to isapi_w...@googlegroups.com, pyPax
On 11/11/2010 4:14 AM, pyPax wrote:
> Hi folks,
>
> I am running a Django site with isapi_wsgi under both IIS6 and IIS7.5.
> Both are using either django-mssql and/or django-pyodbc. Both
> libraries cannot connect to the database with Windows authenticated,
> as apparently the code is run by an Anonymous user.

You mean you have the DB configured to use Windows authentication and it
doesn't work? If so, IIS allows you to specify what Windows user is
used for anonymous requests, and you will need to configure the DB to
allow this user (and possibly adjust other permissions for the user,
depending on how the DB client connects to the server.

> I have set the Application pool to run under the User with SQL Server
> access, but it doesn't seem to be making a difference.

You might like to see what win32api.GetUserName() returns in the django
code just before it attempts to hit the DB - IIRC, IIS will explicitly
switch to the configured anonymous user's account.

HTH,

Mark

Reply all
Reply to author
Forward
0 new messages