Instagram身份验证

时间:2016-03-14 12:11:54

标签: java oauth instagram instagram-api

我的问题是我不知道如何从重定向的URL获取验证码。代码正在身体中回响。

  HttpURLConnection igConnection = (HttpURLConnection) instagramURL.openConnection();
  igConnection.setDoInput(true);
  igConnection.setDoOutput(false);

  if (igConnection.getResponseCode() == HttpURLConnection.HTTP_OK){
    InputStream is = igConnection.getInputStream();

    String response = "";

    if (is != null){
      BufferedReader in = new BufferedReader(new InputStreamReader(is));

      StringBuffer input = new StringBuffer();
      String line;
      while ((line = in.readLine()) != null) {
        input.append(line);
      }
      in.close();

      System.out.println(input.toString());
    }
  }

我得到的是<html> ...

我只想刷新accessToken以防将来过期(检查)。

根据此pattern

,我的授权链接是正确的

0 个答案:

没有答案