473,378 Members | 1,209 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,378 software developers and data experts.

Problem using ASP.Net Impersonation to access UNC share

I am working on an application where a web service (on the web tier)
calls another web/gateway service (on the app tier). This then needs
to save a file to a UNC share on a file server in our internal
network.

The issue that I'm having is that as our app tier is not on a domain,
I am unable to impersonate a domain account to access the share. I am
able to map a network drive to the share from the app tier by
connecting as a domain account but I have been unable to do the same
using ASP.Net. I have tried impersonating a domain account via the
web.config and also via the code.

I have managed to get a POC working by creating a local account on the
app tier and then creating the same account on the file server. If I
set my app to impersonate this local user I am able to save the file
successfully but when I try to impersonate a domain account the
authentication fails.

Has anybody else experienced a similar issue? Is there a way I can
impersonate a domain account on the app tier even though it is not on
the domain?
Aug 28 '08 #1
1 3044
"JoeyNic" <jo***********@googlemail.comwrote in message
news:dc**********************************@r66g2000 hsg.googlegroups.com...
I am working on an application where a web service (on the web tier)
calls another web/gateway service (on the app tier). This then needs
to save a file to a UNC share on a file server in our internal
network.

The issue that I'm having is that as our app tier is not on a domain,
I am unable to impersonate a domain account to access the share. I am
able to map a network drive to the share from the app tier by
connecting as a domain account but I have been unable to do the same
using ASP.Net. I have tried impersonating a domain account via the
web.config and also via the code.

I have managed to get a POC working by creating a local account on the
app tier and then creating the same account on the file server. If I
set my app to impersonate this local user I am able to save the file
successfully but when I try to impersonate a domain account the
authentication fails.

Has anybody else experienced a similar issue? Is there a way I can
impersonate a domain account on the app tier even though it is not on
the domain?
You can't impersonate a domain account unless you have created a trust
relationship between the off domain machine and the domain (in which case
you may as well place the machine on the domain). Unless the local machine
trusts the domain controller on the domain it isn't going to authenticate an
account on that domain.

The 'twin' accounts approach would seem to be your best bet.
--
Anthony Jones - MVP ASP/ASP.NET
Aug 29 '08 #2

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

Similar topics

7
by: Ram P. Dash | last post by:
Now this is a classic. The impersonation fails for CASE I but doesn't fail for CASE II or III. Case I: Client Side Code ----------------- System.Net.NetworkCredential credential = new...
2
by: Peter O'Reilly | last post by:
I am experiencing difficulty access a mapped network drive in an ASP.NET application. While using the .Net framework v 1.1 implementation of System.IO.Directory.Exists(), it fails to recognize a...
4
by: Chris Gatto | last post by:
Hi, I'm having what should be a minor problem but has turned into a 2 day slug fest with ASP.Net. I am simply attempting to authenticate my asp.net application users against users in an AD...
4
by: Garrett | last post by:
Hi all, I am trying to access folders on an Active Directory network share in my ASP code. In my config file I have the following: <identity impersonate="true"...
1
by: Jason MacKenzie | last post by:
I have an asp.net application with a treeview control that accesses a network share and recurses through all the directories and displays the structure on a scree - pretty standard stuff. I...
2
by: Charles Leonard | last post by:
I have a web service running impersonation of a domain account on Windows Server 2003. I need to access a share which the Web Service classes, themselves, appear to be able to create and access. ...
3
by: Carl | last post by:
Using VB .NET how can I enable my program to access a share on another machine and pass the user name and password. I have a computer and share, say "\\computer\share" so I can copy files from it...
1
by: lecnac | last post by:
Sorry for the repost. I must have done something wrong when I tried to post my reply (I can't seem to find it). Anyway, I'd really appreciate any help that anyone could provide. My issue is...
3
by: Code Monkey | last post by:
I've written a windows service in C#. The service copies certain files using a FileSystemWatcher. However, where it copies the files to is a windows share (\\ipaddress \sharename). If I set...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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?

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.