简体   繁体   English

在HTML5 Hybrid App中登录和注册?

[英]Login and registration in HTML5 Hybrid App?

I am a front-end developer. 我是前端开发人员。 I am implementing HTML5 Hybrid app with Phonegap. 我正在使用Phonegap实现HTML5 Hybrid应用。 I have setup all these things for the App but I don't have backend knowledge but I want to first implement registration and login on my first page. 我已经为App设置了所有这些内容,但是我没有后端知识,但是我想首先实现注册并在首页上登录。 I have implemented one apk and this apk working fine in my mobile, But after that, I want to implement validation. 我已经实现了一个apk,并且这个apk在我的手机上运行良好,但是之后,我想实现验证。 I don't know how it will possible but I am thinking about javascript for this( Registration is possible through javascript? ).Can we register form without backend programming Like Java or Php. 我不知道怎么可能,但是我正在考虑使用javascript( 可以通过javascript注册吗? )。我们可以在不进行Java或Php等后端编程的情况下注册表格吗? Right now I am not using any DataBase. 现在,我没有使用任何数据库。 Give me the idea about Login what is the best thing. 给我关于登录的想法是最好的。 As per my thinking database is necessary. 根据我的想法数据库是必要的。 I am new in Hybrid app then please suggest me solution. 我是混合应用程序中的新手,请提出建议。

You could use Javascript at the server side with Node.js and Framewrok Express to handle requests from your mobile device in a RESTFUL API. 您可以在服务器端使用Javascript与Node.js和Framewrok Express一起在RESTFUL API中处理来自移动设备的请求。 For signing up your users is really neccesary a database, to store credentials which they'll authenticate in this case if you want to use technologies oriented to JS one option would be MongoDB. 对于签署用户来说,它实际上是一个数据库,要存储他们将在这种情况下进行身份验证的凭据,如果您想使用面向JS的技术,则可以选择MongoDB。 It's also recommendable use a Framework for your mobile app like Ionic which is based in Angular.js to accelerate your development. 还建议为您的移动应用程序使用一个框架,例如基于Angular.js的Ionic,以加快开发速度。

Here a tutorial how you can achieve authenticate with some of tools I mentioned above: 这里是一个教程,您如何使用上面提到的一些工具实现身份验证:

https://scotch.io/tutorials/authenticate-a-node-js-api-with-json-web-tokens https://scotch.io/tutorials/authenticate-a-node-js-api-with-json-web-tokens

There are also services like Auth0 (No affiliation but we use them for my company). 还有诸如Auth0之类的服务(无隶属关系,但我们将其用于我的公司)。 Depends on how much you plan on scaling user count. 取决于您计划扩展用户数量的多少。 If SaaS or low user count, their free plan is not bad. 如果SaaS或用户数量较少,那么他们的免费计划也不错。

I also wrote a blog on various strategies when it comes to securing APIs from an HTML 5 app Cookies vs Local Storage, etc if helpful. 如果有帮助,我还写了一篇有关从HTML 5应用程序保护API来保护API的各种策略的博客。 https://www.moesif.com/blog/technical/restful-apis/Authorization-on-RESTful-APIs/ https://www.moesif.com/blog/technical/restful-apis/Authorization-on-RESTful-APIs/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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