Implement "Remember Me" option in a PhoneGap application - javascript

I am new to PhoneGap development. My PhoneGap application has a login page and I need to implement a "Remember Me" option into this login page. If the user has checked the "Remember Me" checkbox after entering username & password, the application should remember the user entered username & password and auto fill the information the next time the user launch the application (i.e. username & password should be persisted even when the application is closed, phone is restarted etc).
What is the best approach to implement this in a PhoneGap application..?
I know I can write the username and password to a file and read it back when app is launched. But I have a feeling that this is not the best way to do this due to various reasons including security.
Thanks in advance.

You can look into using an SQLLite database or LocalStorage, as documented here.

Related

Problem with Moodle Login using Web Services

Hello to the whole community. :)
I am currently working on integrating moodle for an e-learning platform. I have implemented most of the functionalities using web services (Javascript Client). But, unfortunately, I find that the web authentication service does not exist.
I said to myself, for authentication at the level of my system without redirecting the user to moodle from the information in the moodle database, I retrieve the password from the login and I test with the data entered by the user but the concern is that the core_user_get_users and core_user_get_users_by_fields functions do not send me the password (encrypted) but just the other information.
Need your help !!
core_user_get_users and core_user_get_users_by_fields are, quite correctly, incapable of sending the user's password, because Moodle itself doesn't know what the user's passwords are.
Moodle only stores a one-way hash of the user's passwords - each time a user logs in, the hash of the password they entered is compared with that in the database and the user is allowed in, if they match. By design, it is very difficult (and time consuming) to start with the hashed password in the Moodle database and figure out the user's password.
If you need a mechanism for logging a user in to Moodle from your system, without them having to enter a password, then you should consider using a Moodle authentication plugin that supports Single Sign On - the standard Moodle authentication plugins are listed at: https://docs.moodle.org/en/Authentication, but you may find that there is a 3rd-party authentication plugin that helps you at: https://moodle.org/plugins/?q=type:auth (https://moodle.org/plugins/auth_saml2 is often a good place to start).

Simple authentication in a alert box for website using Javascript

I want to have a simple authentication for a website, just for testing purpose. On opening the site for ex: www.example.com the browser should ask user to enter a username and password to navigate to index.html.
How can I do this in JavaScript, I don't mind hard coidng the user name and password. I do not want any database connection. Its a simple 3 page static site deployed in a server. Index.html loads on opening the site.
Store the valid user name and password in local javascript variables. On the click event of your login button, compare the input values to your local variables. As long as this is for testing, it will work.

How to auto login into login page after user exits the app?

I have a login page via WCF restful APIs. I am logging in and now the problem after logging in if user exits in the app and try to re open the app, the app doesn't want to ask the user for credentials by storing the previous credentials. It has to automatically redirect to the another page. Any ideas, suggestions? I'm using JavaScript and HTML & Cordova.
Take a look at this answer
Cordova app with autologin feature
This answer is one of the best ways to implement autologin in hybrid apps, to me.

How to validate user login after the first login in an Android app created through Apache Cordova (UI is on SAPUI5)

I am creating an android application using Apache Cordova and my UI is on SAPUI5,is there any way where I can store the user login credentials securely so that user doesn't need to enter user id and password again until he perform logout operation.
I searched for a similar answer for months. I came up with 2 options, one of which was not so secure.
The best answer was to generate a session token and store that token in localStorage. The login would see if the session token is valid and bypass login if it is.
The other, not so secure, option was to hash and save the login information in the localStorage.
Hope this helps.

how to login to mybb forum from an intel xdk application

for christmas i'm developing an intel-xdk app to send to all the users of my mybb forum.
The app need to authenticate the user, only registered forum users can login into.
a first way i thought is to add a php function into the website and call through ajax passing username & password. In this case i know how to implements.
just for learning i would like to know if there is a way to use all the existing server code.
can one intel-xdk authenticate one user over mybb forum? if yes what's the way?

Categories

Resources