javascript 无法使用客户端(隐式)身份验证登录 Instagram
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/23685624/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Can't login to Instagram using Client-Side (Implicit) Authentication
提问by Batuhan Icoz
I'm trying to build a client-side application that allows people to login with their Instagram accounts. Problem is, I'm not sure if that's still possible.
我正在尝试构建一个客户端应用程序,允许人们使用他们的 Instagram 帐户登录。问题是,我不确定这是否仍然可能。
I've coded a sample JavaScript after reading "Client-Side (Implicit) Authentication" section of their related docs.
在阅读了相关文档的“客户端(隐式)身份验证”部分后,我编写了一个示例 JavaScript 。
I'm getting the following error:
我收到以下错误:
{
"code": 400,
"error_type": "OAuthException",
"error_message": "JS login temporarily disabled"
}
From the error message I'm guessing it's not about my code but it's something on Instagram's side. Is there a way for me to do client-side login? Also, if I can't, what are my options?
从错误消息中,我猜这与我的代码无关,而是与 Instagram 相关。有没有办法让我进行客户端登录?另外,如果我不能,我有什么选择?
Thanks.
谢谢。
回答by mike20132013
I had similar issue and this is how I fixed it.
我有类似的问题,这就是我修复它的方式。
You have to uncheck the "Disable implicit OAuth:" by going to :
您必须通过以下方式取消选中“禁用隐式 OAuth:”:
->Manage Clients
->管理客户
->Click edit on the app/webapp.
->在应用程序/网络应用程序上单击编辑。
->Uncheck- Disable implicit OAuth:
->取消选中- 禁用隐式 OAuth:
->Update the settings and try to run it again by going to the link :
->更新设置并尝试通过转到链接再次运行它:
https://api.instagram.com/oauth/authorize/?client_id=CLIENT-ID&redirect_uri=REDIRECT-URI&response_type=token
In the link, replace the values that were provided to you and in the response_type, give value as tokento get the access token and if you want to get the request code, just replace tokenwith the codein the URL.
在链接中,替换提供给您的值,并在response_type 中,将值作为令牌提供以获取访问令牌,如果您想获取请求代码,只需将令牌替换为 URL 中的代码。
Hope this helps for you and for future viewers.. Good luck.. :)
希望这对你和未来的观众有帮助..祝你好运..:)
回答by Hassan Siddique
回答by Batuhan Icoz
So, it seems it's impossible to do JS login at the moment with Instagram.
所以,目前看来用 Instagram 做 JS 登录是不可能的。
But they still allow implicit redirects so the solution is to have a server to make a redirect to your client side application. You only need two endpoints. I've written a small Node.JS app for this which you can find here.
但是它们仍然允许隐式重定向,因此解决方案是让服务器重定向到您的客户端应用程序。您只需要两个端点。我为此编写了一个小型 Node.JS 应用程序,您可以在此处找到。
回答by Sajin M Aboobakkar
I had tried for the same,I think there are not still providing any api to login with Instagram credentials username and password,You can just authenticate your account via
我也试过,我认为还没有提供任何 api 来使用 Instagram 凭据用户名和密码登录,您可以通过以下方式验证您的帐户