Skip to content
This repository has been archived by the owner on Aug 31, 2020. It is now read-only.

Releases: sudocode/ohmy-auth

Legs, Sessions, Components, and Bulk Sets

13 Apr 06:50
Compare
Choose a tag to compare

You can now create new OAuth flows using the legs() function. In addition, you can pass an array to the set() function to set multiple keys/values:

use ohmy\Auth1;

$twitter = Auth1::legs(2)
                ->set(array(
                   'key' => 'foo',
                   'secret' => 'bar',
                   'callback' => 'localhost:3000/'
                ))
                ->request('https://api.twitter.com/oauth/request_token')
                ->authorize('https://api.twitter.com/oauth/authorize')
                ->access('https://api.twitter.com/oauth/access_token');

Also, you no longer need to explicitly call session_start / session_destroy. Sessions are now handled by a special class under ohmy\Components\Session.

By default, the PHPSession will be used. If you want to use MySQL sessions instead, simply create a class that implements the interface found in ohmy\Components\Session.php. Then pass an object of your new class via the override method. You can also override the default Curl class with your own HTTP client object that implements ohmy\Components\Http.php.

use ohmy\Auth1;

Auth1::legs(2)
       ->set(array(
         'key' => 'foo',
         'secret' => 'bar',
         'callback' => 'localhost:3000/'
       ))
      ->override('session', $myCustomSessionObject)
      ->override('http', $myCustomHttpObject);

Enjoy the new release, and please provide any feedback. I plan to add the ability to refresh tokens, reuse old tokens, custom exceptions, better documentation, and more unit tests in future releases.

Official support for PHP 5.3

08 Feb 09:17
Compare
Choose a tag to compare
Merge pull request #6 from sudocode/php-53

Added official support PHP5.3

Authentication can now be restored from a saved token/secret

02 Feb 20:20
Compare
Choose a tag to compare

Added support for Google+, Instagram, and Microsoft Live

01 Feb 22:38
Compare
Choose a tag to compare

Facebook, Fitbit, LinkedIn, and Yahoo!

01 Feb 08:26
Compare
Choose a tag to compare

ohmy-auth now works with Facebook, Fitbit, LinkedIn, and Yahoo!

0.0.2

31 Jan 11:06
Compare
Choose a tag to compare
fixed POST methods

Introducing ohmy-auth!

31 Jan 10:07
Compare
Choose a tag to compare

ohmy-auth is an OAuth 1.0a/2.0 convenience library that leverages promises to simplify OAuth into a series of chained function calls:

Auth1::init(2)
     ->set('oauth_consumer_key', 'key')
     ->set('oauth_consumer_secret', 'secret')
     ->request($request_token_url)
     ->access($access_token_url)
     ->GET($api_url)
     ->then(function($data) {
        # got data
     });

Oma allows a developer to step in at any time of the OAuth flow to inspect and manipulate data. For example, you could chain a then() after an access() call to store your access token into a database.

So far it works with GitHub, Twitter, and Tumblr. Check out the examples for sample code. And stay tuned for more updates!