【问题标题】:oauth working with java but not in androidoauth 可以在 java 中使用,但不能在 android 中使用
【发布时间】:2012-08-29 03:23:03
【问题描述】:

我有一个 Java 程序与服务器通信以进行身份​​验证并显示正确的响应:

public class Example {

 private static final String PROTECTED_RESOURCE_URL = "http://testwebsite.com/";

  public static void main(String[] args)
  {
    OAuthService service = new ServiceBuilder()
                                .provider(TwoLeggedOAuth.class)
                                .apiKey("my_key")
                                .apiSecret("my_secret")
                                .build();
    Token token = new Token("", "");   
    OAuthRequest request = new OAuthRequest(Verb.GET, PROTECTED_RESOURCE_URL);  
    service.signRequest(token, request);         
    Response response = request.send();            

    System.out.println("Response: " + response.getBody());
   }
}

同一程序在集成到 Android 应用程序时无法运行。
我收到消息:oAuth Verification Failed

【问题讨论】:

    标签: java android oauth oauth-2.0 oauth-provider


    【解决方案1】:

    我在 android 版本 2.2 上尝试它,当我尝试使用 2.3 时它开始工作。

    【讨论】:

      猜你喜欢
      • 2012-11-05
      • 2013-04-29
      • 2023-03-21
      • 1970-01-01
      • 2018-07-18
      • 2012-01-01
      • 2018-12-17
      • 2012-11-20
      • 1970-01-01
      相关资源
      最近更新 更多