C# - Impersonation Not Shared With Com Object?
Aug 18, 2010
So I have an ASP DOT NET web service which needs to impersonate Windows Authenticated users. This web service calls into a Com Api to perform database operations.
It seems like the Impersonation does not persist into the Com Api. Is this because the Com DLL is loaded into its own memory space and treated as a separate process? Also what would be some ways to deal with this issue and persist the Impersonation into the Com Api Dll?
Moving the functionality of the Com Api into the dot net code is not an option at this point. Also the Com Api was written in C++.
View 1 Replies
Similar Messages:
Apr 19, 2010
I'm looking for a direct way for server-side code to access a flash shared object. Obviously you can write some javascript that can read flash shared objects via ExternalInterface. But doing that requires a client code execution, and then a push of the shared object data back to the server-side code. This seems rather complicated.
So is there a way for asp.net, php, or any other server-side script to request the data in a flash shared object?
View 1 Replies
Apr 14, 2010
I have a Session Varaible in which I am assinged a List of "MLoad" objects (Ex:- 10 MLoad objects) from the initial search. After that basing some icon click i am trying to get the new filtered results (Ex:- say 1 MLoad object) and assigning them to the public property "ListSearchResults" (See code below). When i do this the original results in the Session are changed(10 MLoad objects are getting replaced with 1 MLoad object ==> which just been filtered). What i have to do so that the "ListSearchResults" in Session is not changed. It is now byref, how to make it byval?
in acreate an object See below code and after retreving t
[Code]....
View 1 Replies
Jan 5, 2010
let me know what does these access modifiers means.private shared vs public shared vs protected shared
View 5 Replies
Dec 13, 2010
I have a shared module in an asp.net web app which gets various information about a group or user. Since the Iuser account on the web does not have enough rights to query the AD, I need to supply an appropriate userid and passcode for the directoryentry in the shared code. Since my credentials so the have the appropriate rights to query the AD I like to impersonate myself(user.identity). This works fine for a webpage, but I can't pass the user.identity object to shared code. I get an error. Is there a way to pass the user.identity object to a shared function in another module?
View 1 Replies
Oct 4, 2010
I am working on converting a project from C# to VB and am facing this weird issue. 1 page cannot compile and I get the reference error, but the weird thing is that the compiler shows the error as coming from ASP.NET generated code. Visual Studio shows me that error is coming from my ASPX page. I cannot seem to figure out why or where this error is occuring. Also if I take the inherits attribute out I don't get the compilation error. The code in aspx page is below:
[Code]....
View 18 Replies
Apr 22, 2010
I am using VS2005, and a newbie at table adapters, DAL & BLL. I have a single dataset (in DAL) and 2 classes (in BLL) named Class1.vb and Class2.vb.
When I try to call a function from Class1 within Class2 I get the error "Reference to a non-shared member requires an object reference".
Here is a sketch of my code structure:
[Code]....
View 3 Replies
Oct 8, 2010
I do not receive this error when I open my website application in vs 2005. When I open in vs 2008, I get this error. What gives?
These lines are underlined in blue:
[Code]....
Businesslogic area is imported into each of 3 pages with this line.
View 9 Replies
Nov 12, 2010
I want to call a non shared function in a shared function in which i am having a textbox control instance. Its giving no error but when i call this shared function from client callback it gives me no response
Any Idea except removing shared from the function.
Here is my code :
<WebMethod()> _
Public Shared Function myF() As String
Dim pg As New _Default
Return "{'Hello':'" & pg.setText & "'}"
End Function
Public Function setText() As String
Dim pg As New _Default
pg.TextBox1.Text = "This is a test"
Return pg.TextBox1.Text
End Function
View 2 Replies
Aug 10, 2010
what is impersonation and when, why to use it?I am not getting it.
View 1 Replies
Sep 7, 2010
I modified the ASP.NET login control to also allow specifying UserRole ('Employee' or 'Volunteer'). Users are authenticated via a call to a webservice written by our client, which accepts username/password/role and returns true or false.If role is 'Employee' it represents an active directory user. The application should impersonate the user with the given username/password.If role is 'Volunteer' the application should run under a set Windows account whose username/password are known in advance (i.e. hard-coded in web.config file).
View 1 Replies
Mar 4, 2010
what is impersonation in asp.net? Is authentication and impersonation both are same ?I googled and found both are one type of security.
View 3 Replies
Jan 14, 2010
I need to pass a NetworkCredential object with the credentials of the currently impersonated user to a web service from an asp.net application.My code looks like this:
WindowsIdentity windowsIdentity = HttpContext.Current.User.Identity as WindowsIdentity;
WindowsImpersonationContext context = windowsIdentity.Impersonate();
try {
[code]...
View 2 Replies
Feb 25, 2010
The masterpage of my site is using a control that reads data from a network share. To make this work on all pages I'm having to enable impersonation for the whole site. But what I want to do is only enable it for the pages that actually read/write to the share. Eg:
<location path="SystemAdmin">
<system.web>
<identity impersonate="true" password="abcdefgh" userName="MYDOMAINAdministrator" />
<authorization>
<allow roles="Admin" />
<deny users="*" />
</authorization>
</system.web></location>
View 4 Replies
Mar 13, 2011
We are in the process of building ASP.NET windows auth application. Where user need to interact with other internal system using the same single sign on. To interact application DB the system relies on App Pool account, for this we are every time doing the imporsanation to before every DB call. We can not have all useres added to DB, or create an SQL account. Which requires password and user to store in Web Config. We can encrypt it again you encrypt with what and etc ..So we have one windows account wihich same windows account used for our app pool as well.
I would like to know from the team is what is the best way to do the DB connection in this case?What is the implcations if we imporsanate the DB calls based on the app pool account ? Is it a best practice? I have read it creates its own thred and stuff, Do we need to worry ?
View 1 Replies
Feb 9, 2011
On http://msdn.microsoft.com/en-us/library/w070t6ka(v=VS.100).aspx there is an example on how to do impersonation with .net 4.0. We have used this example in a class that inherits IDisposable for ease of use. However, when we use this class in a asp.net web application, we notice a slight but steady increase of Pool Paged Bytes in performance monitor. After a week, the application crashes.
I've tried different implementations of the impersonation-class, using http://msdn.microsoft.com/en-us/library/w070t6ka(v=VS.90).aspx and http://support.microsoft.com/kb/306158 as reference, but they all show the same leak.
Where does this leak come from? Is there a problem with the windows api? We are running Windows 2008 R2.
This is our current version of the impersonation class:
public class Impersonator : IDisposable
{
public Impersonator(string username, string domain, string password)
{
if (!ImpersonateValidUser(username, domain, password))[code]....
And this is the performance monitor graph of two webservers using different versions of the class:
When we disable the class, and use global impersonation via web.config, those lines are completely flat.
Update,I have made a test-application that successfully reproduce the problem. It can be downloaded here:
http://rapidshare.com/files/447325211/ImpersonationTest.zip
The result over 18 hours looks like this:
View 1 Replies
Apr 13, 2010
I noticed impersonation is turned on by default in MOSS web configs. I tried disabling it but the web app returns an error. So my question, is it possible to disable impersonation in MOSS? If it is possible are there any special considerations I should be aware of?
If you're interested in why I need to do this...I need to have a custom web part (developed with SmartPart) talk to a separate SQL server using the application pool rather than the current user (Kerberos is enabled). If I set the authentication mode to NTLM I get NTAuthority/ANonymous login errors from my SQL connection. If I turn Kerberos on, the currently logged in user's credentials are passed. If I hard code the user id and password in the connection string it seems to ignore it and default to whichever security model is in place (NTLM or Kerberos).
View 6 Replies
Jun 30, 2010
I've added the identity tag for impersonation. I've configured my site under IIS 5.1. The identity i've added is my domain username/password. But when I run any exe file from my asp.net file, it still runs under "aspnet" user name.
View 1 Replies
Aug 6, 2010
suggest me a good Video to look at that can give me a start on how to use Impersonation?
View 1 Replies
Dec 27, 2010
I am trying to use impersonation on an IIS server while I access Active Directory data. The following code works fine on the localmachine but when I put this same code on an IIS server I get an error: System.DirectoryServices.DirectoryServicesCOMException: An operations error occurred.
If I remove the top 4 lines and add my ID and passcode to the DirectoryEntry, everything works fine. I would prefer to not have my id and passcode anywhere on the web. Any ideas on how to fix this? Dim impersonationContext As System.Security.Principal.WindowsImpersonationContext
View 2 Replies
Sep 2, 2010
I am using impersonation in my ASP.NET application to access network resources. It works fine when I run on my computer, however when I setup the site on IIS6, it does not work. Is there some extra configuration, I need make in IIS for it?1. I created an account "TestUser" with the privilege as "act as operating system" on a server that has the resources which I want to access.2. The impersonation works fine on my computer, when I run from visual studio. My computer is on the network under same domain where the "TestUser" is created.
View 5 Replies
Jun 7, 2010
Summary: One of our web applications requires write access to C:WindowsTemp. However, no matter how much I weaken the NTFS permission, procmon shows ACCESS DENIED.Background (which might or might not be relevant for the problem): We are using OLEDB to access an MS Access database (which is located outside of C:WindowsTemp). Unfortunately, this OLEDB driver requires write access to the user profile's TEMP directory (which happens to be C:WindowsTemp when running under IIS 7.5), otherwise the dreaded "Unspecified Error" OleDbException is thrown.
View 1 Replies
Sep 14, 2010
I am running ASP.MVC 2 with LINQ2SQL on IIS 7.5. I have enabled Windows Authentication with ASP.NET Impersonation. Application pool is running on different domain account [AsiaTestWebUser] is part of windows group [AsiaTestUserGrp]When i enable Asp.net impersonation on MVC web site. Once i hit LogOn from the default page , it's throwing me with below error message
[Code]....
View 1 Replies
Jun 3, 2010
We are using RDLC's in a Asp.net web application. For reasons beyond our understanding, the first call to the database server fails with the following error:
An error has occurred during report processing. Cannot open database "TryParkingIt2" requested by the login. The login failed. Login failed for user 'EXTRANETOurServerNameHere$'.
Run the report again, it works.
Update Click the button the first time, it fails. Click the button again, it works. The account being impersonated is a domain account. Also, this error occurs on all five different report pages, which is why I didn't include any code.
View 1 Replies
Jan 13, 2011
I have a website using Windows Authentication. Note: The accounts are domain accounts.The website is configured to impersonate in the Web.Config using
[Code]....
View 6 Replies