Skip to content

Commit 1b1a320

Browse files
Nickolay PonomarevNickolay Ponomarev
authored andcommitted
Further improve the README
Note the default behavior of `LDAP_USER_OBJECT_FILTER`. Compare the groups and the blueprints examples, and note that the groups examples additionally shows how to use `@login_required` (this was hard to find!)
1 parent eccc305 commit 1b1a320

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

README.md

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,18 @@ if __name__ == '__main__':
4343
app.run()
4444
```
4545

46-
You can take a look at [examples/groups](examples/groups) for a more complete
47-
example using LDAP groups.
48-
49-
You can also take a look at [examples/blueprints](examples/blueprints) for an
50-
example using Flask's
46+
When the user visits the protected URL, the browser will prompt for the
47+
login and password via the built-in HTTP authentication window. Note that
48+
with the default value of `LDAP_USER_OBJECT_FILTER` the login is expected
49+
to match the [`userPrincipalName` attribute](https://ldapwiki.com/wiki/UserPrincipalName)
50+
of the LDAP user, e.g. `[email protected]`.
51+
52+
Once you get the basic example working, check out the more complex ones:
53+
54+
* [examples/groups](examples/groups) demostrates using:
55+
* `@ldap.login_required` for form/cookie-based auth, instead of basic HTTP authentication.
56+
* `@ldap.group_required()` to restrict access to pages based on the user's LDAP groups.
57+
* [examples/blueprints](examples/blueprints) implements the same functionality, but uses Flask's
5158
[application factories](http://flask.pocoo.org/docs/patterns/appfactories/)
5259
and [blueprints](http://flask.pocoo.org/docs/blueprints/).
5360

0 commit comments

Comments
 (0)