如何在android中使用Oauth中的token和secret
我在android中使用OAuth的路标 我得到Http状态代码500 还有如何在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
{"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