Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/181.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/api/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在android中使用Oauth中的token和secret_Android_Api_Oauth_Access Token - Fatal编程技术网

如何在android中使用Oauth中的token和secret

如何在android中使用Oauth中的token和secret,android,api,oauth,access-token,Android,Api,Oauth,Access Token,我在android中使用OAuth的路标 我得到Http状态代码500 还有 {"messages":{"error":[{"code":401,"message":"oauth_problem=parameter_absent&oauth_parameters_absent=oauth_signature_method"}]}} 代码如下: client = new DefaultHttpClient(); ArrayList<N

我在android中使用OAuth的路标

我得到Http状态代码500

还有

{"messages":{"error":[{"code":401,"message":"oauth_problem=parameter_absent&oauth_parameters_absent=oauth_signature_method"}]}}
代码如下:

            client = new DefaultHttpClient();
            ArrayList<NameValuePair> requestParaRegister = new ArrayList<NameValuePair>();`enter code here`
            requestParaRegister.add(new BasicNameValuePair("firstname",_firstName));
            requestParaRegister.add(new BasicNameValuePair("lastname",_lastName));  
            requestParaRegister.add(new BasicNameValuePair("username",_username));
            requestParaRegister.add(new BasicNameValuePair("email", _emailID));
            requestParaRegister.add(new BasicNameValuePair("password",_password));

HttpPost postRequest = new HttpPost("http://*************************/customers");

Signpost只支持两种方法,即“明文和HMAC_SHA1”。但是,在您的情况下,您应该使用“HMAC_SHA1”。请参阅路标中的SignatureMethod枚举

通常,您需要以下参数来签署请求

OAUTH_CONSUMER_KEY
OAUTH_CONSUMER_SECRET
OAUTH_SIGNATURE_METHOD
OAUTH_TIMESTAMP
OAUTH_NONCE
OAUTH_VERSION
OAUTH_TOKEN
OAUTH_TOKEN_SECRET

您可以在

oauth\u signature\u method
上找到有关oauth的更多详细信息。如何使用该方法“oauth\u signature\u method”请阅读手册。回复中已经提到了。你能提供你正在谈论的手册的链接吗。
OAUTH_CONSUMER_KEY
OAUTH_CONSUMER_SECRET
OAUTH_SIGNATURE_METHOD
OAUTH_TIMESTAMP
OAUTH_NONCE
OAUTH_VERSION
OAUTH_TOKEN
OAUTH_TOKEN_SECRET