admin管理员组文章数量:1287651
With instagrams new api changes, it appears that there is no way to get an access_token without having some sort of user interaction. All of the documentation that I have found has stated that there is a mandatory pass through of loggin in authorizing an app via a user interaction(/):
Server-side (Explicit) Flow
Step One: Direct your user to our authorization URL
/?client_id=CLIENT-ID&redirect_uri=REDIRECT-URI&response_type=code Note: You may provide an optional scope parameter to request additional permissions outside of the “basic” permissions scope. Learn more about scope.
Note: You may provide an optional state parameter to carry through a server-specific state. For example, you can use this to protect against CSRF issues.
At this point, we present the user with a login screen and then a confirmation screen where to grant your app access to her Instagram data.
Client-Side (Implicit) Authentication
Step One: Direct your user to our authorization URL
/?client_id=CLIENT-ID&redirect_uri=REDIRECT-URI&response_type=token At this point, we present the user with a login screen and then a confirmation screen where they grant your app’s access to their Instagram data. Note that unlike the explicit flow the response type here is “token”.
With an access_token that refreshes periodically, is it possible to to get the access token without user interaction?
I am trying to display my feed on my site but I haven't found a way besides the embed options they offer after the API changes.
EDIT: My question getting marked as a dupe of Instagram OAuth Access Token expiration for app but I am not looking at figuring out the expiration(that is not explicitly defined in the IG documentation). I want a purely programmatic way to get the the access_token.
With instagrams new api changes, it appears that there is no way to get an access_token without having some sort of user interaction. All of the documentation that I have found has stated that there is a mandatory pass through of loggin in authorizing an app via a user interaction(https://www.instagram./developer/authentication/):
Server-side (Explicit) Flow
Step One: Direct your user to our authorization URL
https://api.instagram./oauth/authorize/?client_id=CLIENT-ID&redirect_uri=REDIRECT-URI&response_type=code Note: You may provide an optional scope parameter to request additional permissions outside of the “basic” permissions scope. Learn more about scope.
Note: You may provide an optional state parameter to carry through a server-specific state. For example, you can use this to protect against CSRF issues.
At this point, we present the user with a login screen and then a confirmation screen where to grant your app access to her Instagram data.
Client-Side (Implicit) Authentication
Step One: Direct your user to our authorization URL
https://api.instagram./oauth/authorize/?client_id=CLIENT-ID&redirect_uri=REDIRECT-URI&response_type=token At this point, we present the user with a login screen and then a confirmation screen where they grant your app’s access to their Instagram data. Note that unlike the explicit flow the response type here is “token”.
With an access_token that refreshes periodically, is it possible to to get the access token without user interaction?
I am trying to display my feed on my site but I haven't found a way besides the embed options they offer after the API changes.
EDIT: My question getting marked as a dupe of Instagram OAuth Access Token expiration for app but I am not looking at figuring out the expiration(that is not explicitly defined in the IG documentation). I want a purely programmatic way to get the the access_token.
Share Improve this question edited May 23, 2017 at 11:47 CommunityBot 11 silver badge asked Jun 7, 2016 at 19:58 ninjasenseninjasense 13.9k19 gold badges77 silver badges93 bronze badges 2- That question does not address the possibility of getting an access_token without user interaction, it only addresses the expiration of the token – ninjasense Commented Jun 8, 2016 at 17:20
- Fair ment. I've deleted the flag. – Karl Gjertsen Commented Jun 8, 2016 at 17:22
3 Answers
Reset to default 1I'm having this issue too. I'm assuming you want to write a script to run things for you.
One (rather lame) solution would be to use selenium, phantom JS, headless chrome, or any other similar tech to visit the login screen to fill in the account credentials (throw security out the window), before grabbing the code from the following redirect URL...
It's a shame that Instagram doesn't allow this type of non-user-required account option.
You can store the access token in your server. As long as its valid, you don't need to ask your users to login.
Keep in mind that the access token has an expiry date. So you have to handle that case too[i.e, on expiry, ask the user to login again and fetch and save the new access token]
Here in the Instagram developer docs, it states:
https://www.instagram./developer/authorization/
Content Display for Personal Website. If you are a developer and you want to showcase Instagram content on a website, then you do not need to submit your app for review. By using a client in sandbox mode, you will still be able to access the last 20 media of any sandbox user that grants you permission.
So if you already have a client set up with Instagram, you should be able to continue to grab your posts from the API as long as you're in "sandbox" mode. You'll only be able to grab posts for your own user account or any that have given your sandbox permission (limit of 10).
If you don't already have an access token, you can use something like Oauth.io. (It's free.)
本文标签: javascriptHow to get instagram accesstoken without user interaction(new api)Stack Overflow
版权声明:本文标题:javascript - How to get instagram access_token without user interaction(new api)? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741316908a2371968.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论