root/AuthKit/trunk/examples/docs/basic.py
| Revision 61 (checked in by thejimmyg, 2 years ago) |
|---|
| Line | |
|---|---|
| 1 | from authkit.authenticate import middleware, sample_app |
| 2 | |
| 3 | def valid(environ, username, password): |
| 4 | return username == password |
| 5 | |
| 6 | app = middleware( |
| 7 | sample_app, |
| 8 | setup_method='basic', |
| 9 | basic_realm='Test Realm', |
| 10 | basic_authenticate_function=valid |
| 11 | ) |
| 12 | |
| 13 | if __name__ == '__main__': |
| 14 | from paste.httpserver import serve |
| 15 | serve(app, host='0.0.0.0', port=8080) |
| 16 |
Note: See TracBrowser for help on using the browser.
