RE: HTTP Authentication

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> -----Original Message-----
> From: Craige Leeder [mailto:cleeder@xxxxxxxxx]
> Sent: Wednesday, November 19, 2008 8:35 AM
> To: Thiago H. Pojda
> Cc: PHP-General List
> Subject: Re:  HTTP Authentication
> 
> Thiago H. Pojda wrote:
> > Guys,
> >
> > I have to access a WS that uses HTTP auth directly with PHP.
> >
> > I've tried using the usual http://user:pw@xxxxxxxxxxx/ but I
couldn't
> get it
> > working. I believe it has something to do with the password
> containing a #
> > (can't change it) and the browser thinks it's an achor or something.
> >
> > All I've seen were scripts to implement HTTP Auth in PHP, nothing
> about
> > actually logging in with PHP.
> >
> > Is it possible to send the authentication headers the first time I
> access
> > the link? I could send all necessary headers to the page I'm trying
> to
> > access and retrieve it's content at once.
> >
> >
> > Thanks,
> >
> 
> 
> Why don't you let yourself in regardless of the credentials and print
> them out to make sure they're being evaluated as you expect.

Well... he said he needs to access a WS, not that he administrates it or
has any control over the authentication, etc.

As for the Basic Authentication, I believe you can send the
authentication info in the headers (instead of the URL). If you have
problems implementing that in straight PHP, perhaps cURL could be of
some assistance.

http://www.httprevealer.com/article_basic_authentication.htm - this
outlines the header formats, etc... just remember--you will need to
Base64 encode "username:password" for the "Authorization" header.

HTH,


// Todd

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux