简体   繁体   中英

How to authorize public users when they access on the specific page, for read-only purposes

Its general type of question. We have web application writen in Zend, and we are making reports for our registred users. Now, we want to create some specific report for nonregistred users and send them link so they can see that report. But we don't want to let other users to access that page.

One idea is to make hashable URN, at least one part, something like

www.myaddress.com/2309039dskdfskj4/ReportStats/ 

What's best solution for this problem

I would send out an email to what non-registered users you do want to show the report to (say people from a mailing list you maintain).

In that email, have a link they can go to: example.com/reportsample.php

On that page, have them confirm their email address (only send requests to users you have on file) and let them know a one-time report request invite has been sent that will expire in 24 hours.

In a table on your database, write a record that stores a random id value and make a field in that record read "NOTVIEWED"

Then, once the user checks their email, they see a link to: example.com/reportsample.php?access=123456 (where 123456 is random ID)

Once the user clicks on it, they can view the report and the database record for that ID is updated to be "VIEWED."

If anyone tries to view that link again, they won't be able to - the user will have to request access again.

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