[英]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. 我想将mysql数据库与用户表一起使用。 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? 我知道在Firebase或Parse的ionic上有很多示例代码,但是用户定义的数据库表是否有任何模板或示例? Thanks!
谢谢!
For connection to your database, you would need some sort of DB Connector to communicate with from your ionic app to your webservice. 为了连接到数据库,您需要某种DB连接器才能从Ionic应用程序与Web服务进行通信。 I will show you a rough workflow on how you can go around doing it.
我将向您展示一个粗略的工作流程,说明如何进行该工作。
Ionic <---> Webservice <---> MYSQL Database Ionic <---> Web服务<---> MYSQL数据库
Ionic pass the user credentials to your webservice (can be php, c# and etc) via (Http POST and etc) Ionic通过(Http POST等)将用户凭据传递到您的Web服务(可以是php,c#等)
Webservice establish an connection with your database and pass those values over. Webservice与您的数据库建立连接,并将这些值传递过来。
DB will return result in which your webservice has to pass back to your ionic app. DB将返回结果,在该结果中,您的Web服务必须传递回离子应用程序。
Your ionic app will then handle the response ,ie(Login success, Go next page) or (Login failed, show error message). 然后,您的ionic应用程序将处理响应,即(登录成功,转到下一页)或(登录失败,显示错误消息)。
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.
但是使用mySQl数据库是可能的。
Possible links u can read up : http://www.w3schools.com/php/php_mysql_connect.asp 您可以阅读可能的链接: http : //www.w3schools.com/php/php_mysql_connect.asp
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.