title: ADAL .NET to ADFS
body: <p>I am trying to do exactly what this library is designed to do: allow my .NET code (currently a test console app) to retrieve a token from ADFS for the current user, and use the token to authenticate with and call a REST Web API endpoint. <a href="http://www.cloudidentity.com/blog/2013/09/12/active-directory-authentication-library-adal-v1-for-net-general-availability/" rel="nofollow">This article</a> calls it the basic flow supported by ADAL.  My organisation run Windows Server 2012 SP2 ADFS.  The console app and ADFS are on-premise.</p>
  
  <p>Can anyone point me to a full example of how to set this up and use it?  The code snippets are fine, but there's a lot around it that's not explained - like what is the Authentication Context endpoint?  What do I ask my sysadmins for?  They have given me an STS endpoint, but that does not seem to work.  I think I need more than just a server URL, probably need to be passed a query string or other extension, but I can't find any explanation around that.  Virtually all the samples and examples I have found deal with registering the Client app with Azure, and I am not using Azure.</p>
  
  <p>My code currently looks like this:</p>
  
  <pre><code>AuthenticationContext authenticationContext = new AuthenticationContext("https://sts.myorg.co.za");
  var token = authenticationContext.AcquireToken("http://myservices/service1", "a8cb2a71-da38-4cf4-9023-7799d00e09f6", new Uri("http://TodoListClient"));
  </code></pre>
  
  <p>but the call to AquireToken fails with an exception saying <code>This method overload is not supported by 'https://sts.myorg.co.za'</code>.</p>
  
  <p>Any help or pointers appreciated!</p>
  
  <p>Thanks,
  Peter</p>