简体   繁体   中英

User authentication with ionic on a database

I'm starting to learn ionic, so this question might be dumb :-)

It's about user authentication (registration and log in) using an email and password.

I'd like to use a mysql database with a user table. Every time a user registers, there's going to be a record in the table with the email and password he enters. And every time a user logs in, it's going to be verified against the database table.

I know there're plenty of example code on ionic with Firebase or Parse, but is there any template or example for a user-defined database table? Thanks!

For connection to your database, you would need some sort of DB Connector to communicate with from your ionic app to your webservice. I will show you a rough workflow on how you can go around doing it.

Ionic <---> Webservice <---> MYSQL Database

  1. Ionic pass the user credentials to your webservice (can be php, c# and etc) via (Http POST and etc)

  2. Webservice establish an connection with your database and pass those values over.

  3. DB will return result in which your webservice has to pass back to your ionic app.

  4. Your ionic app will then handle the response ,ie(Login success, Go next page) or (Login failed, show error message).

Unless you can specify which technologies you want to use, we can't really help you on it. But to use mySQl database is possible.

Possible links u can read up : http://www.w3schools.com/php/php_mysql_connect.asp

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM