CredentialCache with IIS vs personal development s

2019-08-26 20:25发布

问题:

I have a webservice that I am testing. When I use the personal asp.net webserver, the one with the random port everything works fine. It uses my credentials when I pass DefaultCredentials to an ssrs server to run a report.

When I tried to move it to my local IIS server, the DefualtCredentials UserName is blank and the ID that gets pass to the SSRS server is ASPNET.

I turned off Annon access and only Integrated Windows Authentication is on.

My local IIS is 5.1, so it doesn't have application pools as a separate object.

In the web.config authentication is set

<authentication mode="Windows" /> 

Thanks in advance.

UPDATE I do have the

<identity impersonate="true" />

now, but my problem is trickier then originally stated.

The outer webservice calls SSRS webservice and now it works fine in the browser. But when I call the outer webservice from within SSIS, it does not work, when I step through the code the call to the outer webservice occurs but when I make the call to SSRS i get a 401 Authentication error.

I have valid credentials in the HTTP Manager. I have the package protection level at EncryptSensitiveWithUserKey.

Again if I call the outer webservice from a personal ASP.net webserver, even the SSIS works fine. I just have to download the wsdl every time because the port changes and then I have to re-setup the webservice task. I am concern when I go to production.

(I have yet to run a test from code to see how the webservice acts)

UPDATE 2

Again the webservice works in IE, but not in SSIS nor Firefox even when I supply my credentials when I hit the webservice

I know I am getting authenticated properly because

User.Identity.Name 

returns my login name in the webservice, but when I assign defaultCredentials to the reporting service service it still gives me 401 error. I even tried to impersonate the log in that I was logged in as

Dim win As System.Security.Principal.WindowsIdentity = CType(User.Identity, System.Security.Principal.WindowsIdentity)
Dim context As System.Security.Principal.WindowsImpersonationContext = win.Impersonate()

    reportService.Credentials = System.Net.CredentialCache.DefaultCredentials

回答1:

This is the answer I received from Microsoft.

It was my pleasure to discuss your issue over the phone littler earlier. As I was saying that HTTP connection manager does not support Windows Authentication, please have a look at the article at: http://msdn.microsoft.com/en-us/library/ms140114.aspx

Important

The HTTP connection manager supports only anonymous authentication and basic 
authentication. It does not support Windows Authentication.

So, at this point using Script Task to call the Web Services would be an option, however you mentioned that there will be a challenge of moving the package to QA to UAT etc. I agree with you that managing the URL in the proxy class is a challenge.

Please let me know if you have further questions.


Now even this is not true because I showed the gentleman from Microsoft that our web service did require Windows Authentication but what is not working is known as the “double-hop”. That is the credentials do not get passed to the SSRS server.