Python3 using requests to grab HTTP Auth Data

Νίκος Βέργος me.on.nzt at gmail.com
Thu Feb 2 15:13:25 EST 2017


Τη Πέμπτη, 2 Φεβρουαρίου 2017 - 9:38:47 μ.μ. UTC+2, ο χρήστης Ian έγραψε:

> If you want the user to authenticate to your script and not just
> whatever file you're redirecting them to, then you need to configure
> the server to require authorization for the script and not just the
> redirect target. Most likely you would do this with an .htaccess
> directive as Michael Torrie already suggested. Once that's done, then
> as soon as your script is invoked you'll be able to get the
> REMOTE_USER. The <meta> tag has nothing to do with requesting auth and
> you only need it if you want the browser to perform a delayed redirect
> to that file.

I have also came up with this idea but the problem with that approach is that in order for 'files.py' script to run an authentice dialog must come first.

As i have the script coded the 'files.py' need to run first normally and only after a form submit bases on user selection of a a listed file, onlty then the authentication process to be initiated , not earlier.

To see what i eman just visit my website at http://superhost.gr, scroll down on the middle of the page, hit download now image link.

A list of files will be presented to you and when you click someone then the <meta> tage initiate the authentication.

Can this also be done in such a way with .htaccess & .htpasswd ?!



More information about the Python-list mailing list