Download the PHP package giberti/ext-oauth-shim without Composer
On this page you can find all versions of the php package giberti/ext-oauth-shim. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download giberti/ext-oauth-shim
More information about giberti/ext-oauth-shim
Files in giberti/ext-oauth-shim
Package ext-oauth-shim
Short Description An implementation of the pecl OAuth extension in PHP for shared hosts that don't provide it
License MIT
Informations about the package ext-oauth-shim
OAuth Extension Shim
Aims to provides support for OAuth
, OAuthException
, and OAuthProvider
and satisfy the ext-oauth
requirement for composer packages that require it. This is a work in progress.
WARNING: If possible, use the PECL
extension. It's faster!
Quality
Contributing
This is a work in progress, but the OAuthClient
is usable as an alternative on systems that lack support. In some cases it may be preferred as it will not fatal in some edge cases where the PECL client will.
OAuthProvider
is not yet complete. Please consider helping flesh out the OAuthProvider
class or tests or both. This guide to testing with docker can be helpful when trying to contribute. Pull requests are welcome!
Installing
This library requires PHP 7.3 or newer to use, including 8.x up to version 8.3.
Usage
Client
Most of the time, you'll be using this an OAuth client to request data. You'll start by creating an instance of the client and passing in your access token and secret.
Now that you have a configured client, you can start making requests. To issue a simple GET request for a URI you can call fetch()
with the url.
Another common use case is to POST data, for example, posting a Tweet.
This can also be used for more complicated payloads such JSON.
JSON Body
Binary Body
An example of posting a GIF to an endpoint that accepts the binary image data.
Obtaining an Access Token
Some providers do not automatically issue Access Tokens, if the API you are interacting with doesn't give you this token, you will need to create one.
The user's browser will be redirected to the service where they will grant permission to the application. Once they have completed this step, the browser will be redirected back to the callback url you provided in the first code sample.
For all future requests, you'll use the access token to interact with the API.
`
All versions of ext-oauth-shim with dependencies
php Version ^7.3 || ^8.0