Google Document List API中的安全漏洞

时间:2012-06-29 13:09:12

标签: android google-api google-api-java-client

目前,我正在使用HttpClient + XML解析器来使用Google Document List API。

URL url = new URL("https://docs.google.com/feeds/default/private/full?v=3");
URLConnection conn = (HttpURLConnection) url.openConnection();
conn.addRequestProperty("client_id", your client id);
conn.addRequestProperty("client_secret", your client secret);
conn.setRequestProperty("Authorization", "OAuth " + token);

我意识到,即使我不提供Client IdClient secret甚至Simple API key(我只提供身份验证令牌),我仍然可以与Google Doc(Google云端硬盘)进行通信完全没问题。我仍然可以下载和上传文件。

我可以知道,为什么会这样?这是Google API中的安全漏洞吗?

1 个答案:

答案 0 :(得分:0)

您只需要OAuth访问令牌即可访问API。但访问令牌仅在一小时内有效。然后,您将需要刷新令牌和客户端密钥来生成新的。

Check the OAuth2 doc for more info

相关问题