Hi Fam
Download
You will recall that we did a tutorial on MySQL back-ends using a plug n play CRUD REST API (Related Topics below)
This is based on this GitHub Project
In this approach we will use Database Authentication.
1. Create a database called banano with a table named users, it must have column username and column password. You can set the username to be the primary key.
2. In the api.php file, update the details to be using your MySQL database connection. What is new here is the dbAuth middleware and its settings. With sslRedirect we are saying the server uses HTTPS.
What we are saying here is that we will use a database for authorization,
Related Content
Download
You will recall that we did a tutorial on MySQL back-ends using a plug n play CRUD REST API (Related Topics below)
This is based on this GitHub Project
In this approach we will use Database Authentication.
1. Create a database called banano with a table named users, it must have column username and column password. You can set the username to be the primary key.
2. In the api.php file, update the details to be using your MySQL database connection. What is new here is the dbAuth middleware and its settings. With sslRedirect we are saying the server uses HTTPS.
B4X:
$config = new Config([
'driver' => 'mysql',
'address' => '127.0.0.1',
'port' => '3306',
'username' => 'root',
'password' => '',
'database' => 'banano',
'debug' => true,
'tables' => 'all',
'middlewares' => 'sslRedirect,sanitation,dbAuth',
'dbAuth.usersTable' => 'users',
'dbAuth.loginTable' => 'users',
'dbAuth.usernameColumn' => 'username',
'dbAuth.passwordColumn' => 'password',
'dbAuth.registerUser' => '1',
'dbAuth.loginAfterRegistration' => '0',
'dbAuth.passwordLength' => '12',
]);
What we are saying here is that we will use a database for authorization,
Related Content
[Web][SithasoDaisy] Revolutionize Your Ride: The Ultimate Vehicle Expense Tracker App using Api Key Secure MySQL REST API on top of HTTPS
Hi Fam Are you tired of scrambling through piles of receipts and scribbled notes just to keep track of your vehicle expenses? Say goodbye to the hassle and welcome the future of vehicle management with our cutting-edge Vehicle Expense Tracker App! Built with a secure API key authentication...
www.b4x.com
[Web][SithasoDaisy] Secure CRUD MySQL REST API Web App using Api Key on top of HTTPS
Hi Fam This is a fully functional webapp that showcases categories & products. One is able to toggle views between table listing and a grid listing. Both these have functionality to edit, clone, delete records from the database. When adding products, we load categories in a select/combo box...
www.b4x.com
Last edited: