Automate HTTP Basic authentication from PHP script?

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 ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 10-15-2003
Olaf
 
Posts: n/a
Default Automate HTTP Basic authentication from PHP script?

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
Reply With Quote
  #2 (permalink)  
Old 10-15-2003
Ian P. Christian
 
Posts: n/a
Default Re: Automate HTTP Basic authentication from PHP script?

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
Reply With Quote
  #3 (permalink)  
Old 10-16-2003
Olaf
 
Posts: n/a
Default Re: Automate HTTP Basic authentication from PHP script?

"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
Reply With Quote
  #4 (permalink)  
Old 10-16-2003
Ian P. Christian
 
Posts: n/a
Default Re: Automate HTTP Basic authentication from PHP script?

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
Reply With Quote
  #5 (permalink)  
Old 10-17-2003
Dan
 
Posts: n/a
Default Re: Automate HTTP Basic authentication from PHP script?


"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


Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 06:31 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0