I've written a class that allows me to add documents to a SharePoint
Document Library from another web application. The web app runs under
a domain account that has permissions to SharePoint. However, when I
try to do this from a background thread it fails with Access Denied.
I've tested the WindowsIdentity from the background thread and it is
the same. Are background threads not running in the same security
context under ASP.NET 2.0? Following is my code, Button1 works,
Button2 does not.
protected void Button1_Click(o bject sender, EventArgs e) {
SPDocLibDataAcc ess da = new SPDocLibDataAcc ess("http://
staff.mcrcsip.o rg", "");
da.AddDocument( "D:\\Temp\\Lice nsedVehiclesDet ailReport.pdf", "Shared
Documents");
this.lblMessage .Text = "Done!";
}
protected void Button2_Click(o bject sender, EventArgs e) {
ThreadStart ts = new ThreadStart(thi s.UploadFile);
Thread t = new Thread(ts);
t.Start();
this.lblMessage .Text = "Started thread.";
}
private void UploadFile() {
SPDocLibDataAcc ess da = new SPDocLibDataAcc ess("http://
staff.mcrcsip.o rg", "");
da.AddDocument( "D:\\Temp\\Lice nsedVehiclesDet ailReport.pdf", "Shared
Documents");
} 1 1876
I had impersonation enable without realizing it. The foreground
thread was executing under the logged in user's account which had
permissions on the SharePoint site. The background thread was
executing under the identity of the Application Pool, which didn't
have permissions on the SharePoint site. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: ChrisB |
last post by:
Hello:
I am a member of a team creating a .NET application, and we seem to have run
into an issue when trying to implement role based security.
Our application makes use of a fairly common (table based) security model in
which privileges are assigned to roles, which are then assigned users. So,
for example, the user "JSmith" may be assigned to a "SalesRep" role and as a
result have "Add Customer", "View Customer", and "Edit Customer"...
|
by: Mike MacSween |
last post by:
S**t for brains strikes again!
Why did I do that? When I met the clients and at some point they vaguely
asked whether eventually would it be possible to have some people who could
read the data and some who couldn't but that it wasn't important right now.
And I said, 'sure, we can do that later'.
So now I've developed an app without any thought to security and am trying
to apply it afterwards. Doh!, doh! and triple doh!
|
by: Bob Alston |
last post by:
Could develop web pages that would interact with the access/jet database
- like DAP but without the security flaw???
One of Access' competitors (Filemaker Pro as I recall) touts its EASY
way to build web forms using its product. Sounds like they are trying
to beat Access in a new venue - the web.
Bob Alston
bobalston9 AT yahoo DOT com
|
by: Jerry Negrelli |
last post by:
I'm running an ASP.NET application which uses
impersonation & Windows authentication to set the current
Principal. One of my methods was taking an awful long
time to run, so I decided to launch it in a new thread
using the following two lines of code:
Thread bob = new Thread(new ThreadStart(MyMethodName));
bob.Start();
When MyMethodName is executed, it attempts to make a
|
by: John Bowman |
last post by:
Hi,
I've got an app that implements a VSA scripting host engine and runs the VB
..NET script in a separate thread. However, since this is being called from
external VB .NET scripts and runs in a separate thread I need to be certain
that the script when executing, and is making calls back into the main
application (via a DLL assembly), that it has the same security permissions
as does the internal main EXE's code. Is there some way to...
| |
by: hazz |
last post by:
If I successfully run a VS.NET app which includes the following;
************************** APP 1 ****************************
m_iIdnt = new
System.Security.Principal.GenericIdentity(t.UserName,"MyAuthentication");
//user and My authentication type added to Identity
string roles = {"Chief Cook and Bottle Washer", "Master Gardener"};
|
by: Sparky |
last post by:
Hi
I have an vb.net winforms application that needs to launch a thread, and
within that thread change the security context of the current user to a new
one using impersonation. For clarity, the main thread that the application
is running under is Thread A, and the new thread in which i perform the
impersonation under is thread B.
This works fine, but i now need to launch another thread (Thread C) from
within Thread B. This is all...
|
by: David Thielen |
last post by:
Hi;
I am creating png files in my ASP .NET app. When I am running under Windows
2003/IIS 6, the file is not given the security permissions it should have. It
does not have any permission for several users that the directory it is in
has, including IUSR_JASMINE (my system is named jasmine).
Here is the weird part. In my aps .net code I have the following:
String jname = Request.PhysicalApplicationPath + "images\\java_" + fileNum +...
|
by: Gregory Gadow |
last post by:
Still working on this project.
What I have working: I have a service that uses FileSystemWatcher on an
"in box" folder. When a text file appears in the in-box, it copies the
file to a work folder, processes it a bit, goes through a list of rules
and applies the first one that fits. Based on the applied rule, the file
can be printed, copied or deleted, or a user can be sent an email
notification.
I ran in to a problem where...
|
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |