How do I use Windows auth with Identity Server 3?
<p><strong>My goal is a Angular app that consumes a web service, with users of the app/web service authenticated using Windows auth. Users should be able to log into a machine on our Windows domain, open a browser and use the Angular app without logging in again.</strong> </p>

<p><strong>Research</strong></p>

<p>I downloaded all the source code samples from <a href="https://github.com/IdentityServer/IdentityServer3.Samples/" rel="noreferrer">https://github.com/IdentityServer/IdentityServer3.Samples/</a></p>

<p>I worked through the <strong>Simplest OAuth2 Walkthrough</strong> sample. No problems.</p>

<p>I then opened the <strong>Web Host (Windows Auth All-In-One)</strong> sample. I could restore and build the project, after commenting out two lines of code that were causing issues (<em>Clients.cs lines 313,359, setting 'AllowAccessTokensViaBrowser=false'. Probably not relevant.</em>)</p>

<p>When the app was run, I could see the <strong>IdentityServer3 landing page</strong> on localhost:44333. Great.</p>

<p>I could also see the <strong>Windows authentication service metadata</strong> (A SAML document) on localhost:44333/windows. Also, great.</p>

<p>The problem is, I don't know what to do next.  This document seems to suggest that the next step involves writing a client that makes a call to the Windows authentication service to get a token:</p>

<p><a href="http://github.com/IdentityServer/IdentityServer3/issues/1463" rel="noreferrer">http://github.com/IdentityServer/IdentityServer3/issues/1463</a></p>

<p>Is this the right approach? I can't make the code sample work. I am not even sure I can pointing the <code>OAuth2Client</code> at the right place. Please can someone explain this process, or point me a example with a working client? Thank you in advance for help :)</p>

<p><strong>EDIT</strong></p>

<p>I have been doing some further research. I have checked the logs of the Identity server to make sure that the <strong>Adding WS-Federation endpoint</strong> operation completes during configuration. It does.</p>

<p>Then I created a simple console app to call the Windows authentication service, as suggested here: github.com/IdentityServer/IdentityServer3/issues/2318</p>

<p>Having imported <strong>Thinktecture.IdentityModel.Client</strong>, I modifying the code on that page to fit my port numbers etc, I ended up with this:</p>

<pre><code>   var handler = new HttpClientHandler
   {
       UseDefaultCredentials = true
   };
   var oauthClient = new OAuth2Client(
                    new Uri("https://localhost:44333/windows/token"),
                    handler);

   var result = oauthClient.RequestCustomGrantAsync("windows").Result;
</code></pre>

<p>My result object still has a HttpErrorStatusCode of <strong>NotFound</strong>, which makes me sad.</p>

<p><strong>ANOTHER EDIT</strong></p>

<p>I tried pointing the client at the Identity server endpoint, as suggested below by Branimir. So my code now reads:</p>

<pre><code>var oauthClient = new OAuth2Client(
   new Uri("https://localhost:44333/connect/token"),
   handler);
</code></pre>

<p>This does not work either. This is what the Identity server logs say:</p>

<pre><code>Start token request
iisexpress.exe Information: 0 : 04/27/2016 20:35:23 +01:00 [Information] (IdentityServer3.Core.Validation.SecretParser)
 Parser found no secret
iisexpress.exe Information: 0 : 04/27/2016 20:35:23 +01:00 [Information] (IdentityServer3.Core.Validation.ClientSecretValidator)
 No client secret found
iisexpress.exe Information: 0 : 04/27/2016 20:35:23 +01:00 [Information] (IdentityServer3.Core.Endpoints.TokenEndpointController)
 End token request
iisexpress.exe Information: 0 : 04/27/2016 20:35:23 +01:00 [Information] (IdentityServer3.Core.Results.TokenErrorResult)
 Returning error: invalid_client
</code></pre>

<p>So I am no further forward.</p>