ldap3 bind syntax error in flask application
<p>I am trying to  validate username  and password of users in a flask app using <strong>ldap3</strong>. Normal <strong>ldap</strong>  is not installing in <strong>python 3.5</strong>.</p>

<p>The user is entering username and password through login form, I am trying to  authenticate user with <strong>username / password</strong> and allow them to access the index page if it is authenticated.</p>

<p>Does the authentication return true of false so that I can redirect to next page based on outcome.
The <code>LDAP_PROVIDER_URL = "ldaps://appauth.corp.domain.com:636";</code></p>

<p>Please help me with the code for this.
When I type <code>appauth.corp.domain.com</code> or <code>corp.domain.com</code>  as HOST  I get  the  following error</p>

<blockquote>
  <p>(r_web) C:\Users\dasa17\r_web\RosterWeb\RosterWeb>python Roster.py
  Traceback (most recent call last):   File "Roster.py", line 10, in
  
      s = Server(appauth.corp.domain.com, port=636, get_info=ALL) NameError: name 'appauth' is not defined</p>
  
  <p>(r_web) C:\Users\dasa17\r_web\RosterWeb\RosterWeb>python Roster.py
  Traceback (most recent call last):   File "Roster.py", line 10, in
  
      s = Server(corp.domain.com, port=636, get_info=ALL) NameError: name 'corp' is not defined</p>
</blockquote>

<p>I made   some modifications  , now   I  am able to run it  by  giving dummy   username and password.  However, I   am getting a different error now.>>> c = Connection(s,user='dasa17',password='',check_names=True, lazy=False,raise_exceptions=False)</p>

<blockquote>
  <blockquote>
    <blockquote>
      <p>c.open()
           Traceback (most recent call last):
           File "", line 1, in 
            c.open()
           File "C:\Python35\lib\site-packages\ldap3\strategy\sync.py", line 57, in   open
              self.connection.refresh_server_info()
            File "C:\Python35\lib\site-packages\ldap3\core\connection.py", line 1017,    in refresh_server_info
             self.server.get_info_from_server(self)
           File "C:\Python35\lib\site-packages\ldap3\core\server.py", line 382, in     get_info_from_server
             self._get_dsa_info(connection)
            File "C:\Python35\lib\site-packages\ldap3\core\server.py", line 308, in     _get_dsa_info
               get_operational_attributes=True)
             File "C:\Python35\lib\site-packages\ldap3\core\connection.py", line 571,    in search
              response = self.post_send_search(self.send('searchRequest', request,    controls))
            File "C:\Python35\lib\site-packages\ldap3\strategy\sync.py", line 140, in   post_send_search
             responses, result = self.get_response(message_id)
            File "C:\Python35\lib\site-packages\ldap3\strategy\base.py", line 298, in  get_response
              responses = self._get_response(message_id)
             File "C:\Python35\lib\site-packages\ldap3\strategy\sync.py", line 158, in   _get_response
            responses = self.receiving()
            File "C:\Python35\lib\site-packages\ldap3\strategy\sync.py", line 92, in  receiving
              raise communication_exception_factory(LDAPSocketReceiveError, exc)   (self.connection.last_error)
             ldap3.core.exceptions.LDAPSocketReceiveError: error receiving data: [WinError 10054] An existing connection was forcibly closed by the remote host</p>
    </blockquote>
  </blockquote>
</blockquote>