Password Restrict Access to certain view/page


Romeo Ross

Hi David

Please can you advise...

I want to restrict access to a certain view/page via a password:

I figured out I can use the Blockapp, then BlockText function to display you must first put in password before continue but then i am stuck after that.

I got bit of JavaScript to execute after that which I got from stackoverflow and created the JSfunction with it in AB

So it look will something like this:

BlockApp - When I click on the view I want to go to

BlockText- Will display the message to enter password before continue

Password Function - Part I am stuck at.

When this part works it will continue to the unblock function then unblock area.

Then continue to that restricted area, if password fails it brings you to back to main load again.

Thanks


DecSoft

Hello Romeo,

Probably you no need to use pure Javascript to do what you wanted. You can take a look at these two samples: "Promt" and "InputBox". Both of these samples ask to the user for something (a password, for example), and then, using the appropriate app's function (callback) process the user's input in the way that we need.

The problem here are not to ask the user for some password, the problem can be to store that password in the same app. Since our apps are clients apps, somebody can take it an decompile it (for example, if we distribute the app as an APK for Android) and then take the clear password, modify the app behaviour, etc.

In principle, our apps never must store private information inside the app's code, files, etc.. If we need to deal with private information we must store that information in an app's server, and then, serve that private information only when required, for example, when the app's user login in our app's server. Then, if we can't login... we never can reach the private information.

Of course, all the above depend on what you really wanted. Maybe the password that you want to use is not very important, or, is a kind of "game", that is, is not important if someone get the password by decompile the app. In this case, there is no problem to ask the user for a password, and you can use the Promt or the InputBox actions, or just create an app's view that you can use in a "dialog" or in an normal way.

Take a look at the Promt and the InputBox samples, and, if you have any further questions, please, post it here Romeo.



Romeo Ross

Thanks David

Prompt will work.

Regards


DecSoft

Hello Romeo,

You're welcome. Please, if you like, download the latest DecSoft's App Builder release, who contains a new Login app sample (number 173 in App Builder). This new sample may can be of your interest. And, since this sample requires the usage of some server's side scripts and database (provided by the sample too), please, post it here in this thread or open a new one (better) if you have any questions about.


Todo el mundo puede leer el foro de soporte de DecSoft para aprender del mismo, sin embargo, sólo los clientes de DecSoft pueden abrir nuevos hilos. Compre una o más licencias de productos de DecSoft y obtendrá este y otros beneficios.

Este sitio utiliza "cookies" útiles para almacenar sus preferencias.

Bien. Ocultar esta nota. Obtener más información.