Posts tagged php5
How to write a complete OAuth Provider in PHP5
72Today I’m going to talk about a subject that doesn’t have a lot of coverage on the web.
There is a lot of tutorials about how to use OAuth authentication for twitter services or google & such but there is not a lot of information on how to actually make your own oauth provider.
Now if you are reading this post you probably allready know why Oauth is good and what his purpose is but you can check out some info here.
On this post I’m going to use an basic example case and we will go from nothing to actually handling api calls.
You can download the full source code of a working provider from here. It includes the provider described here as well as a basic client to help you test it out…
Related Posts:
Dealing with Monster.com SOAP with PHP5
0Recently I had to set up a system that would post a job offer to monster.com web service using SOAP.
Once I made the script to generate the XML I started looking into the SOAP class that PHP5 provides but I soon started to feel the headache comming !
So I justed wanted to help out If some of you were facing the same issue : FORGET that soap class and use a basic CURL !
Here is my code snippet
$headers=array("Accept: text/xml","Content-Type: text/xml");
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL,"https://208.71.198.74:8443/bgwBroker");
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS, $xml); // your soap xml that you generated earlier
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);
$return = curl_exec($curl);
curl_close ($curl);
And there you go ! you just have to handle the return info.
I hope that this will help someone one day !

Last comments