Comments (7)
@nicktacular Please help us understand a bit more about this issue by providing more information.
- Who is the service provider you are attempting to authorize? Did you build it? Does it provide documentation?
- What is the nature of the nested parameters?
- What action are you trying to take?
from oauth1-client.
@stevenmaguire I responded with a few more details in #42 but I can provide more detail here.
- The specific API I'm working with is https://oauth-api.beatport.com/ - I did not build this but I do work for Beatport as a software engineer.
- The nature of the nested parameters is to pass an array-like structure to provide the necessary request parameters to the backend.
- I'm trying to make any request that uses a query string like
a[b]=1&a[c]=2
.
Currently, I see there being 2 different, but related issues:
- The PHP method
parse_str
will parse[]
as arrays in a query string, thereby resulting in a multi-dimensional array. TheHmacSha1Signature
should be aware of this and deal with this case in some way that does not issue a PHP warning about unexpected arrays:Warning: rawurlencode() expects parameter 1 to be string, array given
- Since OAuth spec is not specific on how to handle the issue of nested arrays, there should be either a) an implementation or b) a way to inject an implementation for a specific API.
I think we can solve in this manner. Create an interface called QueryParserInterface
that allows you to override the method in which queries are parsed and sorted into a string. The default would be called DefaultQueryParser
which uses parse_url
and anyone that wants to modify this can contribute to an adapter implementation.
Thoughts?
from oauth1-client.
Awesome, Thanks for providing this!
Can you add a bit more clarity to these responses?
The nature of the nested parameters is to pass an array-like structure to provide the necessary request parameters to the backend.
Are these parameters being used to create entities? to filter a query of existing entities?
I'm trying to make any request that uses a query string like a[b]=1&a[c]=2.
Can you provide a specific example of a request query string that is causing some problems?
I do think the two points you've made are valid, I am trying to discern the scope of the use case you are experiencing. Service providers implement OAuth (1 and 2!) inconsistently. I want to understand the instigator of this issue to research whether or not other providers, at least the ones I know of, are susceptible.
It is worth noting that another project had this same discussion and the root of the initial concern was more enlightening than the solution being proposed. woocommerce/woocommerce#7833
from oauth1-client.
Edit: Same issue here when passing a multidimensional array as the $bodyParameters
argument to League\OAuth1\Client\Server::getHeaders().
from oauth1-client.
@stevenmaguire - I've not had time to work on this. I will get to this sometime later this month. Thanks.
from oauth1-client.
Hi guys, any updates on this?
from oauth1-client.
Ignore previous comment ;)
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.