简体   繁体   English

在数据库上使用Ionic进行用户身份验证

[英]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数据库

  1. 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#等)

  2. Webservice establish an connection with your database and pass those values over. Webservice与您的数据库建立连接,并将这些值传递过来。

  3. DB will return result in which your webservice has to pass back to your ionic app. DB将返回结果,在该结果中,您的Web服务必须传递回离子应用程序。

  4. 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.

相关问题 带有 Firebase 身份验证用户的 Firebase 数据库数据结构 - Firebase Database data structure with Firebase Authentication user 从存储在笔记本电脑上的数据库中读取以进行用户身份验证 - Reading from a database that is stored on a laptop for user authentication Firebase数据库和身份验证中同一用户的UID不同 - UID for same user is different in Firebase database and authentication FIrebase移动身份验证并将用户保存到数据库 - FIrebase mobile authentication and save user to database 如何同时删除实时数据库中的用户身份验证和用户帐户? - How to remove user authentication and user account in Realtime database at the same time? 具有Ionic 2 Google身份验证的Firebase 3 - Firebase 3 with ionic 2 google authentication 如何仅使用文件而不使用数据库来构建用户认证和登录系统? - How to build an user authentication and login system using only a file but not database? Firebase 身份验证用户 UID 作为实时数据库中的子节点 - Firebase Authentication User UID as child node in Realtime Database 验证后如何将用户数据存储到Firbase数据库中? - How to store user data into Firbase database after authentication? 如何从实时数据库和 Firebase 身份验证中删除用户? Android Java - How to delete user from Realtime Database and Firebase Authentication? Android Java
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM