I am trying to generate oauth-signature, when i try to create the signature using filter[limit] = 20 i always end up getting "Invalid Signature - provided signature does not match"
, but when i exclude the filter[limit] = 20, the signature generated is valid and request works well.
below is the code i am using to generate signature
def generate_oauth_signature(endpoint, params, method)
base_request_uri = CGI::escape(@api_url.to_s + endpoint.to_s)
query_params = []
params.each { |key, value| query_params.push(CGI::escape(key.to_s) + "%3D" + CGI::escape(value.to_s)) }
query_string = query_params.join("%26")
string_to_sign = method.to_s + "&" + base_request_uri + '&' + query_string
return Base64.strict_encode64(OpenSSL::HMAC.digest(OpenSSL::Digest.new('sha256'), @consumer_secret, string_to_sign))
end
can you please suggest as to what could be wrong, thanks.