magento REST API not accessible in iphone -
when try access rest api using iphone have passed following parameter in url , used both methods post , get displays access denied.
oauth_version="1.0", oauth_signature_method="hmac-sha1", oauth_nonce="b0dlzkfmwcan0tj", oauth_timestamp="1366280813", oauth_consumer_key="klkjylsiozbv6vfdsqtuheqo3kmqqzv2", oauth_token="t9pefrwylmg7webyepsqepotlhzbytkp", oauth_signature="neowbclupbiyf9ernhofqol9%2bwo%3d" i have worked rest client plugin available firefox , chrome, rest api work using rest client plugin not accessible in iphone.
i generating random value oauth_timestamp, oauth_signature , oauth_nonce rest api displaying access denied.
please provide suggestions.
//here final_sign signature generated following procedure.
$nonce = substr(md5(uniqid('nonce_', true)),0,16); $temprealm="http://magentohost/api/rest/products"; $realm=urlencode($temprealm); $oauth_version="1.0"; $oauth_signature_method="hmac-sha1"; $oauth_consumer_key="dfddfgdgdfgddf6qgygmyvw7e3"; $oauth_access_token="fdgdfgfdgdfg357gimpdnuejvcbtk51ni"; $oauth_method="get"; $oauth_timestamp=time(); $algo="sha1"; $key="sb88hfdihyg25ipt1by559yzbj2m3861&s7uhaheu8nrx961oxg6uc3os4zgyc2tm"; //consumer secret & token secret //both used in generate signature $data="oauth_consumer_key=".$oauth_consumer_key."&oauth_nonce=".$nonce."&oauth_signature_method=".$oauth_signature_method."&oauth_timestamp=".$oauth_timestamp."&oauth_token=".$oauth_access_token."&oauth_version=".$oauth_version; $send_data=$oauth_method."&".$realm."&".urlencode($data); $sign=hash_hmac($algo,$send_data,$key,1); // consumer key , token secrat used here $fin_sign=base64_encode($sign); echo $fin_sign;
Comments
Post a Comment