su php.net c'è tutta una libreria a riguardo: http://php.net/manual/en/book.oauth.php