简体   繁体   中英

How I can develop a registration and login system Jquery mobile

hello guys at the moment I build a mobile application in jquery mobile my idea is finish the app in jquery mobile and later compile with phone build for IOS and android now my problem is I need build a registration and login pages for the app but dont have much knowledge about this for example I want do this with the best security for users data and have the idea that will need a web server to store and validating the data that will come from the app

for example a user register in my app and the information will be sent to my web server later when the user try login, the app will verify the information for example email and password and if the user put all correct info he will get the access but now I see some tutorials and dont know how I will be doing this can anyone help me or give me some instruccions to do this? I know that jquery mobile dont work with php

you have to setup an http (backend) service which is able to store user-password key-value pairs consistently. the passwords should be md5(+salt) which is the minimum of password security you can do without too much previous knowledge. there are many plugins to do the encryption directly on client side. just take a look here . as your application growth and the security issue got more weight you should think about something like AES encrypted .

furhtermore you have to get an html formular which is asking for the user/password combination. you can send the formular data via an ajax request to your backend. described here .

within the callback of the ajax request you can redirect your session/ the user to secured content or whatever. there are some hidden disadvantages of doing an "virtual" session on client side. better way is to extend your backend service to send an token or something similar after recognizing an valid/known user. or even combination of both techniques, to prevent session hijacking .

the simple backend service is maybe a php/perl/java-serlvet/cpp service. as you are free to choose any available framework. as you like javascript - like i do - you should take a look here: node.js .

I have put together an end-to-end example, with unit tests, based on my own experience doing this. It uses Node.js and MongoDB on the backend and you can easily port it to your favorite stack.

Check it out here: Using MongoDB and Mongoose for User Registration, Login and Logout in a Mobile Application

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