@@ -39,13 +39,19 @@ Your configuration should be declared within your Flask config. Sample configura
3939 LDAP_TLS_VERSION = ssl.PROTOCOL_TLSv1_2 # default: PROTOCOL_TLSv1
4040 LDAP_CERT_PATH = ' /etc/openldap/certs'
4141
42- TIf you want to allways get the entry attribute value as a list, instead of a string if only one item is in the attribute set:
42+ If you want to always get any entry attribute value as a list, instead of a string if only one item is in the attribute list, then set:
4343
4444.. code-block :: python
4545
4646 FORCE_ATTRIBUTE_VALUE_AS_LIST = True
4747
48- Create the ldap instance within your application:
48+ Default is ``False `` and will return a string if only one item is in the attribute list.
49+
50+
51+ Setup
52+ -----
53+
54+ Create the LDAP instance in your application.
4955
5056.. code-block :: python
5157
@@ -159,7 +165,7 @@ Authenticate with Client
159165
160166 with app.app_context():
161167 retval = ldap.authenticate(username, password, attribute,
162- basedn, search_filter' )
168+ basedn, search_filter)
163169 if not retval:
164170 return ' Invalid credentials.'
165171 return ' Welcome %s .' % username
@@ -168,13 +174,14 @@ Authenticate with Client
168174 Bind as user
169175------------
170176
171- To bind as user for the current request save a new connection to `` flask.g.ldap_conn`` :
177+ To bind as user for the current request instance a new connection from ``flask.g.ldap_conn ``:
172178
173179.. code-block :: python
174180
175181 g.ldap_conn = ldap.connect(userdn, password)
176182 user = User.query.get(userdn)
177183
184+
178185 Unit Test
179186---------
180187
0 commit comments