Digitally sign URLs

29 views
Skip to first unread message

Annet

unread,
Dec 8, 2020, 6:42:58 AM12/8/20
to web2py-users
In the control panel I built I use URL(..., user_signature=True) and @auth.requires_signature() to secure the urls.

I the init application I built I have various links to a particular function with different
combinations of args and vars. I want to limit access to that function so only the
explicitly generated links will work i.e. prevent users from generating their own combinations of args and vars.

Is it possible to digitally sign the allowed URLs and check the signature in the action to prevent any other URLs from working, without visitors being logged in?


Kind regards,

Annet

villas

unread,
Dec 9, 2020, 7:44:53 AM12/9/20
to web2py-users
So doesn't the URL(..., user_signature=True) and @auth.requires_signature()  decorator do exactly what you want?
Maybe you want either/or decorator to work,  in which case try the decorator @auth.requires() with your specific logic.
You can also use the URL.verify() method documented in the book.
HTH
Reply all
Reply to author
Forward
0 new messages