Skip to content

Commit

Permalink
fix(oauth): sort parameters in a standard way as per the specs (#721)
Browse files Browse the repository at this point in the history
the signature is now calculated a bit differently to match other
implementations.

BREAKING CHANGE: existing OAuth applications may encounter some issues
leading to `invalid_signature` 401 errors from Magento due to the
removal of natural sorting for parameters when generating the signature
  • Loading branch information
real34 authored and Flyingmana committed Nov 3, 2019
1 parent 9648b1e commit 0e90e98
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Zend/Oauth/Signature/SignatureAbstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ protected function _getBaseSignatureString(array $params, $method = null, $url =
protected function _toByteValueOrderedQueryString(array $params)
{
$return = array();
uksort($params, 'strnatcmp');
ksort($params);
foreach ($params as $key => $value) {
if (is_array($value)) {
natsort($value);
Expand Down

0 comments on commit 0e90e98

Please sign in to comment.