Note that there are some explanatory texts on larger screens.

plurals
  1. POReportingService2005 via WCF - works with impersonation, but not with username/password
    primarykey
    data
    text
    <p>I'm hooking into SSRS 2008's ReportingService2005 service via WCF.</p> <p>I have it working with impersonation, like this:</p> <pre><code>ReportingService2005SoapClient rService = new ReportingService2005SoapClient("endpoint config name", "the url"); rService.ClientCredentials.Windows.AllowedImpersonationLevel = System.Security.Principal.TokenImpersonationLevel.Impersonation; rService.ChannelFactory.Credentials.Windows.ClientCredential = CredentialCache.DefaultNetworkCredentials; </code></pre> <p>But when I try and pass a specific username/password to it instead, like this:</p> <pre><code>rService.ChannelFactory.Credentials.Windows.ClientCredential = new NetworkCredential(username, password, domain); </code></pre> <p>I get this error on the first method call:</p> <blockquote> <p>The HTTP request is unauthorized with client authentication scheme 'Ntlm'. The authentication header received from the server was 'NTLM'.</p> </blockquote> <p>Here's the relevant part of my wcf binding config:</p> <pre><code>&lt;basicHttpBinding&gt; &lt;binding name="ReportingService2005Soap" ... blah blah blah ... messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true"&gt; &lt;readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" /&gt; &lt;security mode="TransportCredentialOnly"&gt; &lt;transport clientCredentialType="Ntlm" proxyCredentialType="Ntlm" realm=""/&gt; &lt;message clientCredentialType="UserName" algorithmSuite="Default" /&gt; &lt;/security&gt; &lt;/binding&gt; &lt;/basicHttpBinding&gt; </code></pre> <p>I'm confused by the error message mentioning Ntlm in two different cases.</p> <p>So the question is - which of the two squillion different WCF settings do I need to fiddle with to get this to work? : ) </p> <p>edit: here is the authentication bit from RSReportServer.config from the SSRS server:</p> <pre><code>&lt;Authentication&gt; &lt;AuthenticationTypes&gt; &lt;RSWindowsNegotiate/&gt; &lt;RSWindowsNTLM/&gt; &lt;/AuthenticationTypes&gt; &lt;EnableAuthPersistence&gt;true&lt;/EnableAuthPersistence&gt; &lt;/Authentication&gt; </code></pre> <p>and from the SSRS web.config:</p> <pre><code>&lt;authentication mode="Windows" /&gt; </code></pre> <p>edit: I'll mark the best answer so far for now, but this is still open because I havent yet found a solution that lets me set arbitrary credentials in code.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload