Skip to content
This repository has been archived by the owner on Dec 19, 2018. It is now read-only.

HttpBinding HttpClientCredentialType.Windows IIS10 - Core 2.0 #1276

Closed
cgountanis opened this issue Nov 20, 2017 · 6 comments
Closed

HttpBinding HttpClientCredentialType.Windows IIS10 - Core 2.0 #1276

cgountanis opened this issue Nov 20, 2017 · 6 comments

Comments

@cgountanis
Copy link

cgountanis commented Nov 20, 2017

Trying to connect to SSRS Execution. Works fine on my development machine, soon as I move to IIS I get errors with the same exact remote SSRS server. Any tips tricks, most of the help from Google is the old way of doing it with XML file configurations. What really gets me is that it works from my development machine using IISExpress, why not on a TEST Server using IIS?

AppPool No Managed Code

The rest of the Core 2.0 MVC application works perfectly. Why would it work remote on my machine via VPN then throw error like that on TEST server which is on same network? I really think this has something to do with IIS.

basicHttpBinding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Windows;

var serviceSoapClient = new ReportExecutionServiceSoapClient(basicHttpBinding, new EndpointAddress($"{model.ReportServerUrl}/ReportExecution2005.asmx"));

serviceSoapClient.ClientCredentials.Windows.AllowedImpersonationLevel = System.Security.Principal.TokenImpersonationLevel.Impersonation;

serviceSoapClient.ClientCredentials.Windows.ClientCredential = (NetworkCredential)(new NetworkCredential() { UserName = model.Username, Password = model.Password, Domain = model.Domain });

Error:

System.AggregateException: One or more errors occurred. (The HTTP request is unauthorized with client authentication scheme 'Negotiate'. The authentication header received from the server was ''.) ---> System.ServiceModel.Security.MessageSecurityException: The HTTP request is unauthorized with client authentication scheme 'Negotiate'. The authentication header received from the server was ''.

https://github.com/dotnet/corefx/issues/25376

@Tratcher
Copy link
Member

So you're doing a WCF client request from your ASP.NET Core application to separate WCF server using a manual username and password? If that's not working then it's most likely an issue with the WCF client which lives over here: https://github.com/dotnet/corefx/

@cgountanis
Copy link
Author

I posted there but it is so strange it works from VS then not IIS when hosted.

@Tratcher
Copy link
Member

Please include links when cross-posting bugs.

The biggest difference between VS/IIS Express and IIS is that they run as different users. IIS Express runs as yourself, where your IIS app runs under a restricted app pool identity. The accounts likely have different permissions. You can change your IIS app pool to use your own account to test this.

@cgountanis
Copy link
Author

Yeah, will give that another try. We have older .NET 4.5 applications running the default appPool with no issues but they are using the SSRSViewer, where as in Core I am forced to use the Execution endpoint and do it myself.

@cgountanis
Copy link
Author

Moved to dotnet/wcf#2398.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants