Since in PUT requests the input stream can be read only once it is sometimes necessary to pass the parameters to the OAuth validation method. For instance, in services when using the REST server the input is read by the ServicesContext object and then oauth_common_verify_request() fails since the OAuth object tries to read the input stream again but it is already consumed so it can not build the right parameters. As explained in https://drupal.org/node/2137349 (that patch needs this to work).

This can be solved by using in oauth_common_verify_request() the same parameters used in DrupalOAuthRequest::from_request() and pass them:

function oauth_common_verify_request($http_method = NULL, $http_url = NULL, $parameters = NULL) {
  $req = DrupalOAuthRequest::from_request($http_method, $http_url, $parameters);
  ...
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jaimealsilva’s picture

jaimealsilva’s picture

Issue summary: View changes
jaimealsilva’s picture

Status: Active » Needs review