|
|
лет назад: 2 | |
|---|---|---|
| .. | ||
| cache | лет назад: 2 | |
| controllers | лет назад: 2 | |
| db | лет назад: 2 | |
| documents | лет назад: 2 | |
| Makefile | лет назад: 2 | |
| README.md | лет назад: 2 | |
| app.c | лет назад: 2 | |
| appweb.conf | лет назад: 2 | |
| esp.json | лет назад: 2 | |
This sample shows how to configure a simple form-based login using ESP with passwords stored in a user database. This sample uses the a web form for entering username and password credentials.
This sample uses:
Notes:
This sample keeps the passwords in an application database esp.json. The test password was created by using mprMakePassword in the database migration under db/migrations.
Session cookies are created to manage server-side session state storage and to optimize authentication.
The sample creates three routes. A "public" route for the login form and required assets. This route does not employ authentication. A default route that requires authentication for web content. And an action route for the login controller that processes the login and logout requests.
esp
The server listens on port 4000 for HTTP traffic and 4443 for SSL. Browse to:
http://localhost:4000/
This will redirect to SSL (you will get a warning due to the self-signed certificate). Continue and you will be prompted to login. The test username/password is:
joshua/pass1