English 中文(简体)
O 核查错误
原标题:Oauth verification error

我试图利用奥乌特进行核查。 我的榜样守则是:

ArrayList <NameValuePair> params = new ArrayList<NameValuePair>();
  boolean flag=false;
  URL url;

  String oauth_nonce="q14F5ApN4Ka5RJGbYgabXwMSZ4BxVrlNGedN9zoFAoi3rc7dpLjIgri1erAAriPu";
  String oauth_timestamp="1336069726";
  String signatureString =
    URLEncoder.encode("device_id=id_here")
    +URLEncoder.encode("&device_type=psw_here")
    +URLEncoder.encode("&oauth_consumer_key=consumer_key_here...&oauth_nonce=" +
      oauth_nonce+
      "&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1336069726&oauth_version=1.0");

  String percent_encoded_url = URLEncoder.encode("http://www.example.com");
  String signatureBaseString = "POST"+
    "&"+percent_encoded_url+
    "&"+signatureString;

  String oauth_signature=URLEncoder.encode(computeHmac(signatureBaseString, "aWAQTWR7VvHapaNhWBCL0VaUdGN2xzN4&"));

  String headerValue ="OAuth "+
    "oauth_consumer_key=""+"consumer_key_here..."+"","+
    "oauth_signature_method="HMAC-SHA1"+"","+
    "oauth_signature=""+oauth_signature+"","+
    "oauth_timestamp="1336069726"+"","+
    "oauth_nonce=""+oauth_nonce+""," +        
    "oauth_version="1.0"+""";


  HttpPost httppost = new HttpPost("http://www.example.com/");

  httppost.setHeader("Content-Type","application/x-www-form-urlencoded");
  httppost.setHeader("Authorization",headerValue);
  HttpEntity httpentity = new UrlEncodedFormEntity(params);

  HttpClient httpclient = new DefaultHttpClient(clientConnectionManager, httpparams);

  StringBuilder sb = new StringBuilder();
  try {

   HttpResponse response = httpclient.execute(httppost);

当我发出要求时,总是说Bad Apmat。 我不知道奥乌特。 我对我的错误没有想法。 谁能指导我正确方向?

问题回答

它认为,你正在以正确方式生成签名,但服务器用通用<代码>信号表示,因为:

www.un.org/chinese/ga/president 你们需要为每一项请求随机产生一种新的非礼。

<>秒钟<>,每次申请,均需在万国邮联的目前时间。 如果奥阿瑟公司得到正确执行,它将允许在很近的将来或过去修建一些时间。 因此,确保你的锁定正确无误。

从我能告诉你的签字一代看,至少如果你试图找回象征性的请求,你就会看上去。 与以上两点相提并论,让我知道:





相关问题
Android - ListView fling gesture triggers context menu

I m relatively new to Android development. I m developing an app with a ListView. I ve followed the info in #1338475 and have my app recognizing the fling gesture, but after the gesture is complete, ...

AsyncTask and error handling on Android

I m converting my code from using Handler to AsyncTask. The latter is great at what it does - asynchronous updates and handling of results in the main UI thread. What s unclear to me is how to handle ...

Android intent filter for a particular file extension?

I want to be able to download a file with a particular extension from the net, and have it passed to my application to deal with it, but I haven t been able to figure out the intent filter. The ...

Android & Web: What is the equivalent style for the web?

I am quite impressed by the workflow I follow when developing Android applications: Define a layout in an xml file and then write all the code in a code-behind style. Is there an equivalent style for ...

TiledLayer equivalent in Android [duplicate]

To draw landscapes, backgrounds with patterns etc, we used TiledLayer in J2ME. Is there an android counterpart for that. Does android provide an option to set such tiled patterns in the layout XML?

Using Repo with Msysgit

When following the Android Open Source Project instructions on installing repo for use with Git, after running the repo init command, I run into this error: /c/Users/Andrew Rabon/bin/repo: line ...

Android "single top" launch mode and onNewIntent method

I read in the Android documentation that by setting my Activity s launchMode property to singleTop OR by adding the FLAG_ACTIVITY_SINGLE_TOP flag to my Intent, that calling startActivity(intent) would ...

From Web Development to Android Development

I have pretty good skills in PHP , Mysql and Javascript for a junior developer. If I wanted to try my hand as Android Development do you think I might find it tough ? Also what new languages would I ...

热门标签