ehough / coauthor
OAuth client backed by ehough/shortstop
This package's canonical repository appears to be gone and the package has been frozen as a result.
v1.0.0
2013-08-27 20:35 UTC
Requires
- php: >=5.2.0
- ehough/shortstop: ~2.0.0
Requires (Dev)
- ehough/mockery: ~0.8
- phpunit/phpunit: 3.7.*
This package is not auto-updated.
Last update: 2019-02-27 11:08:49 UTC
README
This library is no longer maintained. OAuth library designed for ehough/shortstop
integration.
Features
- Adheres as closely as possible to RFC 5894
- Excellent test coverage
- OAuth 1.x only - for now
Sample Usage
//instance of ehough_shortstop_api_HttpClientInterface $httpClient = ... //instance of ehough_coauthor_spi_v1_TemporaryCredentialsStorageInterface $credentialsStorage = new ehough_coauthor_impl_v1_SessionCredentialsStorage(); //instance of ehough_coauthor_spi_v1_SignerInterface $signer = new ehough_coauthor_impl_v1_Signer(); //instance of ehough_coauthor_spi_v1_RemoteCredentialsFetcherInterface $credentialsFetcher = new ehough_coauthor_impl_v1_DefaultRemoteCredentialsFetcher($httpClient, $signer); //instance of ehough_coauthor_api_v1_ClientInterface $client = new ehough_coauthor_impl_v1_DefaultV1Client($credentialsFetcher, $credentialsStorage, $signer); //build client credentials $clientCredentials = new ehough_coauthor_api_v1_Credentials('identifier', 'secret'); //will fetch and store temporary credentials in a PHP session, then redirect to the given URL $client->commenceNewAuthorization($server, 'http://something.com/oauth/fetchTokens.php', $clientCredentials); OR //will fetch new token/access credentials $token = $client->fetchTokenCredentials($server, 'credentials-id', 'verification-code', $clientCredentials); OR //will sign a single HTTP request, with the optional $token credentials $client->sign($request, $clientCredentials, $token);