Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with signatures for query strings without values #65

Open
spiasecki opened this issue Mar 13, 2018 · 1 comment
Open

Problem with signatures for query strings without values #65

spiasecki opened this issue Mar 13, 2018 · 1 comment

Comments

@spiasecki
Copy link

spiasecki commented Mar 13, 2018

What is the correct way to generate the signature for requests with query string that has no key=value just a string without "=" sign for example https://domain/path?querystring

The service im connecting with for urls like that returns invalid signature error.
So who is not compliant with the RFC ? the service or the subscriber implementation ?

With one simple modification to the prepareParameters method i got the requests working, I can make a PR but i dont know it would be a valid change.

private function prepareParameters($data)
{
        // Parameters are sorted by name, using lexicographical byte value
        // ordering. Ref: Spec: 9.1.1 (1).
        uksort($data, 'strcmp');
        foreach ($data as $key => $value) {
            if ($value === null) {
//              unset($data[$key]); // current code
                $data[$key] = ""; // modification needed to make requests with a valid sig
            }
        }
        return $data;
}
@michalv8
Copy link

I am also having this issue - I am using RQL queries to filter request results and oauth-subscriber is ignoring my query. In case of url like this http://example.com?eq(foo,bar) part eq(foo,bar) is ignored.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants