5

I am using the Client Object Model to interface my .NET App with SP 2010. What I am finding curious is that I am using default authentication, and whenever I make my connection, I am ending up connected as the domain administrator account, despite being logged into windows as a different user. Correct me if I am wrong, but shouldn't I be connecting as my windows user?

Is there somewhere this may be getting cached on the client? (Pls. Note I already cleared both IE and Firefox's caches/settings/etc)

I tried using the other authentication methods, and even setting my own credential override, but to no avail. It seems nothing but default credentials will work.

Can someone help me?

2 Answers 2

1

Go to Internet Explorer -> Internet Options -> Security -> Trusted Sites -> Sites -> Add your Sharepoint 2010 URL here -> Close -> Custom Level -> Drag the Slider to the Extreme Bottom -> User Authentication -> Logon -> Ensure that the "Prompt for Username and Password" is selected. -> OK -> OK

And then try to login with your non-default account

By the way, you have tried the following right?

ClientContext context = new ClientContext(URL);
context.Credentials = new NetworkCredential("username", "password");
5
  • Vardhaman, Thanks for your reply. I DID try that, however... When I used just my username, nothing changed(my credentials didnt change).. When I used "DOMAIN\username" for my username.. then it just failed... so, it seemed like a no-go. I will try the other method though. Thanks.
    – Andrew
    Apr 28, 2011 at 16:45
  • Oh and I also used the other NetworkCredential invocation with the domain parameter -- no effect (no change) I Changed the settings you suggested to no avail. IE will prompt me for a password every time, but it is always defaulted to the domain admin. Any idea where this is cached?
    – Andrew
    Apr 28, 2011 at 16:52
  • Could you please tell me what are you trying to achieve? I mean if you are creating a site or something similar, it is possible that the site is getting created with the right credentials but since you are able to sign in with only the Admin account, you see it as if the site is created with the Admin account? Apr 28, 2011 at 19:11
  • I am creating a Client-Side Add-in that uses the SharePoint Client Object Model to perform various functions on the SharePoint Repository. If the issue is with the SharePoint Site itself (if there is some sort of lo-gin restriction) Could you point me to where that setting is within SharePoint? I have looked all over, but I could have easily missed something server-side.
    – Andrew
    Apr 29, 2011 at 15:44
  • I believe the problem is with the SharePoint Site Itself. Try creating another admin account and from that account, delete the current admin account (which is being automatically defaulted) and see if the issue persists. Apr 30, 2011 at 10:43
0

It's a bit of a long shot, but is this an impersonation issue?

If your .NET application pool identity is the domain administrator and you are not using impersonation you would connect to SharePoint as the administrator and not the currently logged in user.

I'm not really a developer so let me know if that is utter nonsense :-).

1
  • Hey All, So I build a new Sharepoint Server (a virtual Machine this time) and when I logged into this one, the problem vanished. Since I can deduce that the issue is server related, any ideas where the problem may live, or do I just need to scrub the server?
    – Andrew
    Jun 30, 2011 at 15:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.