CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2007
    Posts
    56

    [RESOLVED] impersonate user SharePoint 2010 client object model

    I have a .net asp app that updates a SP form. I am using the Client object model. Currently when inserting a record the record is inserted using the App pool ID. Is it possible to somehow set the context to use the ID of the person logged into the webapp or a custom ID separate from the default. I can't find any data in this in the web or gong through the context methods. Can this be done?

  2. #2
    Join Date
    Jun 2005
    Location
    JHB South Africa
    Posts
    3,772

    Re: impersonate user SharePoint 2010 client object model

    i'm not too sure but this article on learning sharepoint has a few details, and have you looked into using a different Authentication type within sharepoint...
    Articles VB6 : Break the 2G limit - Animation 1, 2 VB.NET : 2005/8 : Moving Images , Animation 1 , 2 , 3 , User Controls
    WPF Articles : 3D Animation 1 , 2 , 3
    Code snips: VB6 Hex Edit, IP Chat, Copy Prot., Crop, Zoom : .NET IP Chat (V4), Adv. ContextMenus, click Hotspot, Scroll Controls
    Find me in ASP.NET., VB6., VB.NET , Writing Articles, My Genealogy, Forum
    All VS.NET: posts refer to VS.NET 2008 (Pro) unless otherwise stated.

  3. #3
    Join Date
    Mar 2007
    Posts
    56

    Re: impersonate user SharePoint 2010 client object model

    Unfortunately, changing the Authentication type is not possible with our current setup. However, I found that you could impersonate a particular user by using something like the following code (sorry I don't have my actual code with me so doing from memory):

    Code:
    clientcontext.credentials = new NetworkCredentials(<username>,<Password>,<domain>)
    When you send the data up the client object model it will use the credentials set instead of the app pool.

    Sorry, forgot to come back and update this when I came up with the resolution.

  4. #4
    Join Date
    Jun 2005
    Location
    JHB South Africa
    Posts
    3,772

    Re: [RESOLVED] impersonate user SharePoint 2010 client object model

    N.P. on the delay to come back ..Just glad you did come right, and thanks for posting your solution, So many members don't bother comming back, leaving so many threads unresolved..
    Articles VB6 : Break the 2G limit - Animation 1, 2 VB.NET : 2005/8 : Moving Images , Animation 1 , 2 , 3 , User Controls
    WPF Articles : 3D Animation 1 , 2 , 3
    Code snips: VB6 Hex Edit, IP Chat, Copy Prot., Crop, Zoom : .NET IP Chat (V4), Adv. ContextMenus, click Hotspot, Scroll Controls
    Find me in ASP.NET., VB6., VB.NET , Writing Articles, My Genealogy, Forum
    All VS.NET: posts refer to VS.NET 2008 (Pro) unless otherwise stated.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured