Re: Python3 using requests to grab HTTP Auth Data

2017-02-02 Thread Νίκος Βέργος
Τη Πέμπτη, 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

Re: Python3 using requests to grab HTTP Auth Data

2017-02-02 Thread Ian Kelly
On Wed, Feb 1, 2017 at 5:22 PM, Νίκος Βέργος wrote: > > # Give user the file requested > > print(''' content="5;url=http://superhost.gr/data/files/%s;>''' % realfile) > > authuser = os.environ.get( 'REMOTE_USER', 'Άγνωστος' ) > print( authuser

Re: Python3 using requests to grab HTTP Auth Data

2017-02-01 Thread Νίκος Βέργος
# Give user the file requested print('''http://superhost.gr/data/files/%s;>''' % realfile) authuser = os.environ.get( 'REMOTE_USER', 'Άγνωστος' ) print( authuser ) Trying this, feels liek i'm almost there except

Re: Python3 using requests to grab HTTP Auth Data

2017-02-01 Thread Νίκος Βέργος
Τη Πέμπτη, 2 Φεβρουαρίου 2017 - 1:51:52 π.μ. UTC+2, ο χρήστης Ian έγραψε: > On Wed, Feb 1, 2017 at 2:51 PM, Νίκος Βέργος wrote: > > Τη Τετάρτη, 1 Φεβρουαρίου 2017 - 11:41:28 μ.μ. UTC+2, ο χρήστης Michael > > Torrie έγραψε: > >> On 02/01/2017 01:51 PM, Νίκος Βέργος wrote: >

Re: Python3 using requests to grab HTTP Auth Data

2017-02-01 Thread Ian Kelly
On Wed, Feb 1, 2017 at 2:51 PM, Νίκος Βέργος wrote: > Τη Τετάρτη, 1 Φεβρουαρίου 2017 - 11:41:28 μ.μ. UTC+2, ο χρήστης Michael > Torrie έγραψε: >> On 02/01/2017 01:51 PM, Νίκος Βέργος wrote: >> > as well as input() for both user & pass combo but iam not getting in >> >

Re: Python3 using requests to grab HTTP Auth Data

2017-02-01 Thread Νίκος Βέργος
Τη Τετάρτη, 1 Φεβρουαρίου 2017 - 11:41:28 μ.μ. UTC+2, ο χρήστης Michael Torrie έγραψε: > On 02/01/2017 01:51 PM, Νίκος Βέργος wrote: > > as well as input() for both user & pass combo but iam not getting in chrome > > the basic pop-up HTTP auth window. > > > > Any idea why? > > What you're

Re: Python3 using requests to grab HTTP Auth Data

2017-02-01 Thread Michael Torrie
On 02/01/2017 01:51 PM, Νίκος Βέργος wrote: > as well as input() for both user & pass combo but iam not getting in chrome > the basic pop-up HTTP auth window. > > Any idea why? What you're describing is not something you can do with an interactive Python script. HTTP-level authentication is

Re: Python3 using requests to grab HTTP Auth Data

2017-02-01 Thread Νίκος Βέργος
Τη Τετάρτη, 1 Φεβρουαρίου 2017 - 9:22:46 μ.μ. UTC+2, ο χρήστης Chris Angelico έγραψε: > You should use the input() function (called raw_input() in Python 2) > for a user name, and the getpass module for the password: I have just tried === # Give user the file

Re: Python3 using requests to grab HTTP Auth Data

2017-02-01 Thread Νίκος Βέργος
Τη Τετάρτη, 1 Φεβρουαρίου 2017 - 9:22:46 μ.μ. UTC+2, ο χρήστης Chris > You should use the input() function (called raw_input() in Python 2) > for a user name, and the getpass module for the password: i have just tried: # Give user the file requested url =

Re: Python3 using requests to grab HTTP Auth Data

2017-02-01 Thread John Gordon
In Peter Pearson writes: > > How can i ASK the user for http auth data and store them isntead of > > giving them to the script? > Maybe like this? > user = raw_input("User: ") > password = raw_input("Password: ") If it doesn't

Re: Python3 using requests to grab HTTP Auth Data

2017-02-01 Thread Chris Angelico
On Thu, Feb 2, 2017 at 2:10 AM, Νίκος Βέργος wrote: > # Give user the file requested > url = "http://superhost.gr/data/files/%s; % realfile > > user, password = 'user', 'passwd' > > r = requests.get( url, auth = (user, password) ) # send auth unconditionally >

Re: Python3 using requests to grab HTTP Auth Data

2017-02-01 Thread Peter Pearson
On Wed, 1 Feb 2017 07:10:39 -0800 (PST), Νίκος Βέργος wrote: > # Give user the file requested > url = "http://superhost.gr/data/files/%s; % realfile > > user, password = 'user', 'passwd' > > r = requests.get( url, auth = (user, password) ) # send auth unconditionally > r.raise_for_status()

Python3 using requests to grab HTTP Auth Data

2017-02-01 Thread Νίκος Βέργος
# Give user the file requested url = "http://superhost.gr/data/files/%s; % realfile user, password = 'user', 'passwd' r = requests.get( url, auth = (user, password) ) # send auth unconditionally r.raise_for_status() == How can i ASK the user for http auth data and