title: Use OWIN Ws-Federation package to authenticate against ADFS 3.0
body: <p>I have an MVC intranet site that needs to use AD accounts for authentication. </p>
  
  <p>I setup ADFS 3.0 (Win Server 2012 R2) and followed <a href="http://www.cloudidentity.com/blog/2014/02/12/use-the-on-premises-organizational-authentication-option-adfs-with-asp-net-in-visual-studio-2013/" rel="nofollow noreferrer">this</a> to setup the ADFS Relying Party Trust. </p>
  
  <p><a href="http://www.cloudidentity.com/blog/2014/02/20/ws-federation-in-microsoft-owin-componentsa-quick-start/" rel="nofollow noreferrer">This</a> other post introduces the Ws-Federation OWIN components and I'd like to use it. It mentions how to connect to an Azure AD but nothing regarding ADFS. </p>
  
  <p>I tried setting the configuration properties "MetadataAddress" and "Wtrealm" to match what I configured in ADFS but at runtime I get an error:</p>
  
  <pre><code>A default value for SignInAsAuthenticationType was not found in IAppBuilder Properties. 
  This can happen if your authentication middleware are added in the wrong order, or if one is missing.
  </code></pre>
  
  <p>I am looking for the proper way remove this error</p>