Python code running as Anonymous user?

已查看 9 次
跳至第一个未读帖子

pyPax

未读,
2010年11月10日 12:14:432010/11/10
收件人 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

未读,
2010年11月11日 17:25:342010/11/11
收件人 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

回复全部
回复作者
转发
0 个新帖子