Page 1 of 1

Basic Authentication

Posted: Thu Mar 29, 2007 3:34 pm
by GeXus
I'm trying to access an API that has basic authentication, how would I go about authenticating myself in php? Obviously, i have the necessary credientials

Posted: Thu Mar 29, 2007 3:49 pm
by nickvd
How do you expect us to answer your question without knowing what api you're talking about?

Read their docs?

Posted: Thu Mar 29, 2007 3:56 pm
by GeXus
It's basic authentication, i'm pretty sure it's universal. http://en.wikipedia.org/wiki/Basic_auth ... ion_scheme

Posted: Thu Mar 29, 2007 4:14 pm
by nickvd
I still suggest you read the api's documentation, as assuming things will get you in trouble.


Basic HTTP Authentication: http://ca.php.net/features.http-auth

Posted: Fri Mar 30, 2007 4:02 am
by stereofrog
@GeXus, from what I understand you are trying to access another site/webservice and need to authorize yourself with http auth. If this is true, I suggest you use CURL, read about CURLOPT_HTTPAUTH and CURLOPT_USERPWD on the curl_setopt() page.