Comments (5)
So what you're talking about effectively is a generic way to interact with OAuth 1 providers?
If that's the case, I would strongly recommend using guzzle/guzzle
with the guzzle/oauth-subscriber
plugin/addon/subscriber. I use this myself in apps for making requests against Twitter, and use the OAuth 1 client for the logic of logging in. We @philsturgeon, @alexbilbie and I, when discussing the OAuth clients, had plans for keeping it lightweight and targeted at OAuth-only. @philsturgeon was actually planning on building a Twitter API client but that was abandoned.
Maybe they can weigh in here. I'm happy to take the package in the direction the community needs as well.
from oauth1-client.
Yeah. Guzzle is a good idea. I will take a look at that as a course of research into the project inspiring the question.
from oauth1-client.
@bencorlett could you provide an example of how this works?
from oauth1-client.
I think #18 will go a long way towards resolving this. With that patch applied, I was able to create a trait with these methods:
public function post($url, array $body = [])
{
$credentials = $this->getCredentials($this->getToken());
$headers = $this->client->getHeaders($credentials, 'POST', $url, $body);
$request = $this->client->createHttpClient()->post($url, $headers, $body)->send();
$response = $request->getBody();
return json_decode($response);
}
protected function getCredentials(array $token)
{
$credentials = new TokenCredentials;
$credentials->setIdentifier($token['identifier']);
$credentials->setSecret($token['secret']);
return $credentials;
}
I greatly prefer this to having to use the oauth-subscriber
plugin, as it duplicates much of what oauth1-client
already does.
from oauth1-client.
The project that inspired the original post is now using Guzzle and the OAuth1 Subscriber plugin.
For the record, I like the PR @shadowhand is proposing. Since there is a request open, I will close this issue.
from oauth1-client.
Related Issues (20)
- Twitter could not authenticate temporary credentials HOT 2
- Class 'Symfony\Component\EventDispatcher\Event' not found HOT 3
- Problem with league/oauth1-client version 1.6.2 upgrading to 1.7 HOT 3
- Guzzle HTTP Client configuration HOT 1
- Composer deprecation notices
- Composer psr-4 autoloading HOT 1
- Breaking change for v1.8.0 HOT 11
- baseString composition fails when port is specified in URI HOT 2
- [PHP 8] Warning on EncodesUrl HOT 17
- Options for authorization URL HOT 3
- Avoid "functions" from dependencies HOT 3
- Trello "An unknown application" HOT 2
- Last release is broken HOT 2
- SignatureInterface is not correctly imported after recent Twitter server changes
- Invalid oauth_verifier parameter
- PHP 8.1 support
- Not sure how to configure signature element
- Magento provider no longer works (outdated hash algorithm)
- Invalid auth/bad request Etsy
- Don't support proxy? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from oauth1-client.