Java 我们如何从Instagram获得访问令牌
我需要用Java编写一个从Instagram搜索媒体的应用程序。我的应用程序不是web应用程序,而是作为独立的java进程运行的。我们需要搜索符合特定条件的照片,我们打算解决以下查询Java 我们如何从Instagram获得访问令牌,java,instagram,instagram-api,Java,Instagram,Instagram Api,我需要用Java编写一个从Instagram搜索媒体的应用程序。我的应用程序不是web应用程序,而是作为独立的java进程运行的。我们需要搜索符合特定条件的照片,我们打算解决以下查询 e.g a. photos from a certain geo location (city | state | country | zipCode | lat/long) b. photos under a certain category (e.g. entertainment, sports) 因为我的应
e.g
a. photos from a certain geo location (city | state | country | zipCode | lat/long)
b. photos under a certain category (e.g. entertainment, sports)
因为我的应用程序既不是web应用程序也不是移动应用程序。我们如何获得要在我的应用程序中使用的访问令牌
是否可以通过提供clientId、clientSecret、用户名和密码来获取访问令牌?您需要浏览器交互才能检索访问令牌。对于您的用例,最简单的方法如下:
http://localhost
作为URL。在“安全”选项卡中,取消选中“禁用隐式OAuth”https://api.instagram.com/oauth/authorize/?client_id=CLIENT-ID&redirect\u uri=redirect-uri&response\u type=token
(使用步骤1中的CLIENT-ID
和redirect-uri
,不要忘记对URL进行编码,例如http://localhost
变成http%3A%2F%2folocalhost
)http://localhost/#access_token=ACCESS-令牌
——这是您的访问令牌这是一个不需要的解决方法。Instagram显然不喜欢服务器到服务器的用例。这显然不违背你的清晰解释。