473,387 Members | 1,590 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Impersonate NT user from Anonymous login

I have an ASPX page that needs to display data from an Access DB that
resides on a network resource other than the running server. To access
the web page itself, I need IIS to have anonymous login set to true,
but to access the Access DB I need to pass an authenticated network
user. Not for the DB's sake but for the network directory that it
resides on.
Some more environment background: large company with tight server
control. I don't directly work for the IT dept., so I need to make
this as easy on IT as possible. Meaning, I can't do any server
configuration (IIS settings or machine.config) and can not store my
database on the server. Everything needs to be run from the .Net
project.
I've tried the following methods with no success:
1. <identity impersonate="true" userName="domain\Username"
password="password"/>
fails because this user is not setup on the machine running IIS and
I won't be able too.
2. set the User name and password in IIS anonymous access config to
the authenticated user. will not work because I will not be able to
edit these values in production.
3. attempted to use API's from MS's KB
failed because it uses tokens based on the current user, which
returned 0 for the token so the impersonation never executes.

thanks,
Alex Jamrozek

Nov 19 '05 #1
8 2136
Approach #1 is, in my opinion, going to be the easiest method going
forward. What type of error are you seeing in this case?

--
Scott
http://www.OdeToCode.com/blogs/scott/

On 3 Feb 2005 11:07:51 -0800, "ajamrozek" <aj*******@msn.com> wrote:
I have an ASPX page that needs to display data from an Access DB that
resides on a network resource other than the running server. To access
the web page itself, I need IIS to have anonymous login set to true,
but to access the Access DB I need to pass an authenticated network
user. Not for the DB's sake but for the network directory that it
resides on.
Some more environment background: large company with tight server
control. I don't directly work for the IT dept., so I need to make
this as easy on IT as possible. Meaning, I can't do any server
configuration (IIS settings or machine.config) and can not store my
database on the server. Everything needs to be run from the .Net
project.
I've tried the following methods with no success:
1. <identity impersonate="true" userName="domain\Username"
password="password"/>
fails because this user is not setup on the machine running IIS and
I won't be able too.
2. set the User name and password in IIS anonymous access config to
the authenticated user. will not work because I will not be able to
edit these values in production.
3. attempted to use API's from MS's KB
failed because it uses tokens based on the current user, which
returned 0 for the token so the impersonation never executes.

thanks,
Alex Jamrozek


Nov 19 '05 #2
For some reason it varies between
-System.Data.OleDb.OleDbException: Unspecified error
Or
-The Microsoft Jet database engine
cannot open the file '(unknown)'. It is already opened exclusively by
another user, or you need permission to view its data

Nov 19 '05 #3
Can the IT department make the IIS server a Domain member? if it is a domain
member then you should be able to authenticate with user: domain\username

"ajamrozek" <aj*******@msn.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
I have an ASPX page that needs to display data from an Access DB that
resides on a network resource other than the running server. To access
the web page itself, I need IIS to have anonymous login set to true,
but to access the Access DB I need to pass an authenticated network
user. Not for the DB's sake but for the network directory that it
resides on.
Some more environment background: large company with tight server
control. I don't directly work for the IT dept., so I need to make
this as easy on IT as possible. Meaning, I can't do any server
configuration (IIS settings or machine.config) and can not store my
database on the server. Everything needs to be run from the .Net
project.
I've tried the following methods with no success:
1. <identity impersonate="true" userName="domain\Username"
password="password"/>
fails because this user is not setup on the machine running IIS and
I won't be able too.
2. set the User name and password in IIS anonymous access config to
the authenticated user. will not work because I will not be able to
edit these values in production.
3. attempted to use API's from MS's KB
failed because it uses tokens based on the current user, which
returned 0 for the token so the impersonation never executes.

thanks,
Alex Jamrozek

Nov 19 '05 #4
There is a possiblity that the IIS server will be on the domain, but I
want to assume it won't be. I'm developing on a laptop that is not
part of the domain, which I think mimics the production environment.
The IIS server will more than likely not be part of the domain as the
Access DB network resource; same with the clients.

Nov 19 '05 #5
ajamrozek,
The error "System.Data.OleDb.OleDbException" look like its from
the application but "The Microsoft Jet database engine
cannot open the file '(unknown)'. It is already opened exclusively by
another user, or you need permission to view its data"

Seems someone else is using the file!
But do you have any NTFS permission created for the file?

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 19 '05 #6
yeah i'm not worried so much about the oledbexception as i am about the
jet database err. I know what's causing it; to open a .mdb file a
..ldb file must be created in the same directory. To do this, the app
needs to be authenticated on the server. It has nothing to do with the
file being open or what permissions are applied to the file (though
those things would cause errors of their own also).

Nov 19 '05 #7
ajamrozek,
So you got it fixed!!

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 19 '05 #8
lol, no. that last post was more of a further qualification of my
problem, in that, I know what the problem is, I just can't fix it yet.

Nov 19 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Michelle | last post by:
Hello! I have an ASP.NET application (1.1 framework) that needs to be able to read/write files on a network share. The access to this file share will be fairly restricted, so I need to...
14
by: Ian Frawley | last post by:
Anyone used the WindowsIdentity class with success? I find if I try to change the current identity to one that exists on another machine and then try to perform and action on that machine i.e....
4
by: Alvaro Pereira | last post by:
I have a ASP.NET project that prints a report to a NETWORK- PRINTER. I have impersonate=true in my web.config, but all reports are printed under ASPNET user (the one that is setted in...
3
by: Maellic | last post by:
Hi, The website I am working on is built with ASP.NET and connects to a SQL Server 2000 database. The web server and database are on the same machine. I have recently tried to modify the timeout...
6
by: Erez Shor | last post by:
Hi, I need to build and asp page which access a remote windows server's registry and create a registry key. In order for the ASP page to be able to access the registry on the remote server I need...
1
by: Svein Terje Gaup | last post by:
I have a website running on Windows 2000 Server, that should be able to retrieve data from a datawarehouse on another machine running Windows 2000 Server, SQL Server 2000 and SQL Server 2000...
0
by: kkos | last post by:
I noticed the following issue posted as a double-hop issue in many discussion boards but found no answers that explain how to pass the second hop with windows auth from IIS ASPX page to remote SQL...
4
by: =?Utf-8?B?QXZhRGV2?= | last post by:
ASP.Net 2. We are migrating to Windows 2008 64 bit Server with IIS 7 from Windows 2003 32 Bit with IIS 6. A few library classes we wrote uses impersonation in code like explained in this...
5
by: WT | last post by:
Hello, IIS6 on W2K3, .net 3.5, Sql 2005. All sp applied. My site is using windows authentication only and the web application connects to sql server residing on another server in the same...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.