Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8114605
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T03:11:48+00:00 2026-06-06T03:11:48+00:00

I have an MVC3 webapplication which runs as a DOMAIN\USER1 account. This user has

  • 0

I have an MVC3 webapplication which runs as a DOMAIN\USER1 account. This user has SPN in AD set and is trusted for delegation.

I want this application to access sharepoint server on behalf of the caller and upload the file for her/him. I use the following code

Dim request = HttpWebRequest.Create(http://sharepoint.domain.com)

request.Method = WebRequestMethods.Http.Head
request.PreAuthenticate = True
Dim identity = New WindowsIdentity(callerName & "@domain.com")
Dim impContext = identity.Impersonate()
'###### At this point identity.ImpersonationLevel is `Impersonate` not `Delegate`

request.Credentials = CredentialCache.DefaultNetworkCredentials
'###### DefaultNetworkCredentials is empty (Username, domain and password are all empty strings)

Dim response As HttpWebResponse

Try
    response = request.GetResponse()
    Return JsonSuccess()
Catch ex As WebException

    '###### I get 401 Unauthorized exception
    Return JsonError(ex.Message)
Finally
    impContext.Undo()
End Try

My question is. Should the impersonation level at this point be Impersonate or Delegate (Sharepoint runs on a different machine than IIS server)?
In AD I also configured protocol transition for the sharepoint and HTTP, so maybe Impersonate should change to Delegate after it makes the request? I have no idea, guidance will be appreciated.

Another question is – shouldn’t CredentialCache.DefaultNetworkCredentials contain at least the username of the impersonated user?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T03:11:49+00:00Added an answer on June 6, 2026 at 3:11 am

    I found the answer here:

    http://support.microsoft.com/kb/810572

    “Kerberos does not work in a load-balanced architecture and IIS drops back to NTLM authentication. Because you cannot use NTLM for delegation, any applications or services that require delegation do not work. For more information, click the following article number to view the article in the Microsoft”

    And that was exactly the case. I tried now with another machine that is not load-balanced and it works.

    The only thing that still surprises me is that ImpersonationLevel of the identity is still Impersonate not Delegate…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have written an ASP.NET MVC3 Web application which runs perfectly inside the Visual
This is about asp.net mvc3 web application. We have used Object cache to store
I have an MVC3 application that has a custom HandleErrorAttribute so that I can
I have a asp.net MVC3 web application in which i search for a certain
I'm using MVC3 to build a web application. In this application I have an
I have a mvc3 web application which uses jqgrid extensively. I just came to
i have created an mvc3 web application that uses forms based authentication. one part
I am working on a web application (asp.net mvc3) I have a Main div.
I have MVC3 installed on my dedicated server and I have an mvc3 website
I have MVC3 project & Valums file uploader . The code is following <script

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.