title: IdentityServer4 with LDAP/AD authentication without UI
body: <p>I'm currently working on a project where I'm trying to set up a service based on IdentityServer4 (<a href="https://github.com/IdentityServer/IdentityServer4" rel="nofollow noreferrer">https://github.com/IdentityServer/IdentityServer4</a>) that authenticates users by querying a local Active Directory via LDAP. </p>
  
  <p>To achieve that, I also included the IdentityServer4.LdapExtension (<a href="https://github.com/Nordes/IdentityServer4.LdapExtension" rel="nofollow noreferrer">https://github.com/Nordes/IdentityServer4.LdapExtension</a>) in my project. The working example from the repository works fine (<a href="https://github.com/Nordes/IdentityServer4.LdapExtension/tree/master/Sample/IdentityServer" rel="nofollow noreferrer">https://github.com/Nordes/IdentityServer4.LdapExtension/tree/master/Sample/IdentityServer</a>) - but the custom logic is part of the UI, and I need my service to operate without any UI. </p>
  
  <p>Simply adding </p>
  
  <pre><code>.AddLdapUsers&lt;ActiveDirectoryAppUser&gt;(Conf.GetSection("ldap"), UserStore.InMemory) 
  </code></pre>
  
  <p>as described in the documentation does not change the request pipeline, as the provided login/validation methods are never executed - they are only triggered with calls from the UI (AccountController). However, as I said, I don't want to integrate any UI in this service and rather use the interface which the Token-Endpoint already provides (POST request with client_id and client_secret, response with JWT).</p>
  
  <p>Is there a way to integrate LDAP authentication without rewriting big parts that work out-of-the-box as desired?</p>