| | |
| | | """ Simple BFG application demonstrating use of repoze.who in "hybrid" mode. |
| | | |
| | | - repoze.who middleware intercepts and validates existing request credentials, |
| | | leaving 'REMOTE_USER' in the WSGI environ if they are OK> |
| | | leaving 'REMOTE_USER' in the WSGI environ if they are OK. |
| | | |
| | | - Application handles login / logout directly, using the repoze.who API |
| | | to validate credentials and set headers. |
| | |
| | | plugins = |
| | | """ |
| | | |
| | | # oh emacs python-mode, you disappoint me """ |
| | | |
| | | api_factory = None |
| | | |
| | | def _configure_api_factory(): |
| | |
| | | </html> |
| | | """ |
| | | |
| | | # oh emacs python-mode, you disappoint me """ |
| | | |
| | | # Clients have to know about these values out-of-band |
| | | SECRET = 's33kr1t' |
| | | COOKIE_NAME = 'auth_cookie' |
| | |
| | | login_name = request.POST['login_name'] |
| | | password = request.POST['password'] |
| | | remote_addr = environ['REMOTE_ADDR'] |
| | | tokens = userdata = '' |
| | | if _validate(login_name, password): |
| | | headers = [('Location', came_from)] |
| | | ticket = auth_tkt.AuthTicket(SECRET, login_name, remote_addr, |