The code was written for this article.
This example is based on the official example (Example - Form based Auth) but uses a MySQL database as backend storage. Form based auth includes authentication, route authorization via routes config, access permissions on view files and session access on View files.
Learn more about Security design, Authentication, Authorization and Form Auth scheme.
Create MySQL database and import data
The db schma with demo data is located at docs/dbschema/schema.sql
edit config file: config/aah.conf
database {
driver = "mysql"
host = "localhost"
port = "3306"
username = "root" # change to yours
password = "mysql" # change to yours
name = "aah-form-based-auth" # change to your db
max_idle_connections = 20
max_active_connections = 30
max_connection_lifetime = 2
}
git clone https://github.com/vulcangz/aah-form-based-auth.git
You need to have a running RabbitMQ server with the default URI "amqp://guest:guest@localhost:5672/" available.
cd aah-form-based-auth
aah run
The application will take you to the login page. From there, it is self explanatory. Happy coding!
Navigate these URLs with various credentials listed on the login page. Observe the application logs to learn more.