This is a discussion on Automate HTTP Basic authentication from PHP script? within the PHP Language forums, part of the PHP Programming Forums category; Hello, i am trying to automate Basic HTTP authentication from within a PHP script. Does anyone know if this is ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hello,
i am trying to automate Basic HTTP authentication from within a PHP script. Does anyone know if this is possible? I was looking into sending a header-string like this: "Authorization: Basic sdsdsdsdsdjk=" but this doesn't seem to work like i expected. Basically, what i am trying to do is enable a user to link to a non-public webpage through another webpage. So i want to send the needed username and password from the PHP page, to avoid having a login popup screen appear. Thanks, Olaf |
|
|||
|
Olaf wrote:
> Hello, > > i am trying to automate Basic HTTP authentication from within a PHP > script. Does anyone know if this is possible? I was looking into > sending a header-string like this: > > "Authorization: Basic sdsdsdsdsdjk=" > > but this doesn't seem to work like i expected. > > Basically, what i am trying to do is enable a user to link to a > non-public webpage through another webpage. So i want to send the > needed username and password from the PHP page, to avoid having a > login popup screen appear. Perhaps I'm misunderstanding something here, but you can do this http://username:password@server:port/page This will allow a link to include a username and password. Kind Regards, Ian P. Christian |
|
|||
|
"Ian P. Christian" <pookey@pookey.co.uk> wrote in message news:<bmjvmo$m1o$4@goat.anlx.net>...
> Olaf wrote: > > > Hello, > > > > i am trying to automate Basic HTTP authentication from within a PHP > > script. Does anyone know if this is possible? I was looking into > > sending a header-string like this: > > > > "Authorization: Basic sdsdsdsdsdjk=" > > > > but this doesn't seem to work like i expected. > > > > Basically, what i am trying to do is enable a user to link to a > > non-public webpage through another webpage. So i want to send the > > needed username and password from the PHP page, to avoid having a > > login popup screen appear. > > Perhaps I'm misunderstanding something here, but you can do this > > http://username:password@server:port/page > > This will allow a link to include a username and password. > > Kind Regards, > > Ian P. Christian this is indeed one solution..the thing is that i don't want the user to see/know the username/password combination.. Olaf |
|
|||
|
Olaf wrote:
> this is indeed one solution..the thing is that i don't want the user > to see/know the username/password combination.. > > Olaf For a browser to access a page directly that requires a username and password, it needs to know them! The work account is to make a script that acts are a kinda proxy, look into the curl functions, or the PEAR HTTP classes. Kind Regards, Ian P. Christian |
|
|||
|
"Olaf" <olaf@ilink.nl> wrote in message news:20b0db67.0310160421.df62cf0@posting.google.co m... > "Ian P. Christian" <pookey@pookey.co.uk> wrote in message news:<bmjvmo$m1o$4@goat.anlx.net>... > > Olaf wrote: > > > > > Hello, > > > > > > i am trying to automate Basic HTTP authentication from within a PHP > > > script. Does anyone know if this is possible? I was looking into > > > sending a header-string like this: > > > > > > "Authorization: Basic sdsdsdsdsdjk=" > > > > > > but this doesn't seem to work like i expected. > > > > > > Basically, what i am trying to do is enable a user to link to a > > > non-public webpage through another webpage. So i want to send the > > > needed username and password from the PHP page, to avoid having a > > > login popup screen appear. > > > > Perhaps I'm misunderstanding something here, but you can do this > > > > http://username:password@server:port/page > > > > This will allow a link to include a username and password. > > > > Kind Regards, > > > > Ian P. Christian > > > this is indeed one solution..the thing is that i don't want the user > to see/know the username/password combination.. > > Olaf A *little* better would be to hide the url containing the usrname/pwd in a hidden frame on an earlier page. I believe most browsers will then cache the username/pwd pair for all subsequent accesses. If someone pours through your source html, they could still find it, but it wouldn't be as obvious as having it appear in the address window on your browser. Dan |