Want to use two-legged OAuth to sign a request? Here’s a super-stripped-down example of how to do it.
- Put this file on a server (this could just be
http://localhost/myfile.php, if you have a web server installed).
- Browse to the file.
When called without a parameter, this script will make an OAuth signed request to itself, with a GET parameter
server set to true. When the script is called with the
server parameter set, it will check the signature of the request. If the signature is valid, it will return
orale!. If the signature is invalid, it will terminate and return
For those reading this in an RSS reader, you can see the code on github.