Page 1 of 3

Password-Protect Download Button

Posted: Mon Jul 07, 2014 3:47 pm
by Mike6580064

How can I password-protect a button that, when clicked, downloads a file from the database?


Password-Protect Download Button

Posted: Mon Jul 07, 2014 3:51 pm
by Evgene Karachevtsev

Hello Mike,

Hope this link will help: https://getsatisfaction.com/apperyio/...


Password-Protect Download Button

Posted: Mon Jul 07, 2014 4:09 pm
by Mike6580064

Evgene,

Sorry I wasn't clear on my previous question.

I have a button that opens a file from my database on click event. However, I want to display a password input dialog box when button is clicked so that the user has to enter a correct password in order to open the linked file. Does this make sense? The user needs permission to open the file.


Password-Protect Download Button

Posted: Tue Jul 08, 2014 4:49 am
by Yurii Orishchuk

Hi Mike,

Files collection has "acl" field.

You can set this field like you need and control access by internal users mechanism.

Please read more about acl here http://devcenter.appery.io/documentat...

Regards.


Password-Protect Download Button

Posted: Tue Jul 08, 2014 12:37 pm
by Mike6580064

Yurii,

Does this mean that a user already has to be logged into the app?


Password-Protect Download Button

Posted: Tue Jul 08, 2014 5:08 pm
by Evgene Karachevtsev

Hello Mike,

Not necessarily. You don't have to register every user. You may have a service account and the user will get the file by entering under this account.


Password-Protect Download Button

Posted: Tue Jul 08, 2014 5:35 pm
by Mike6580064

I'm currently using a universal login and password for my app (1 user) because there are download links to sensitive files.

Instead of having to log into the app on startup, I want to have a password popup box that fires when the download button (to a sensitive file) is clicked.

Am I still going the route of the "acl" field? If so, what else do I need to do besides adding the following to the files' "acl" fields?

{"USER _ID":{"read":true,"write":false}}


Password-Protect Download Button

Posted: Wed Jul 09, 2014 10:18 pm
by Yurii Orishchuk

Hi Mike,

If file has some limitations for read you have to pass "sessionToken" in this link.

Make direct URL with following way: /[fileName]?sessionToken=[userSessionToken]]https://api.appery.io/rest/1/db/files...

See details here: http://devcenter.appery.io/documentat...

So you can use following use case:

Before user starts to download the file app shows him some dialog form where he can specify login and password.

With this form user logins into db and get session token.

Then you can make direct link in way described above. And user can download the file with this link.

Regards.


Password-Protect Download Button

Posted: Thu Jul 10, 2014 1:24 pm
by Mike6580064

Yurii,

How would I implement the dialog box with the password input field only (no username)?


Password-Protect Download Button

Posted: Thu Jul 10, 2014 2:05 pm
by Kateryna Grynko

Hi Mike,

If I understand you correctly, you could probably use the same username as a password.