如何检查/调试Instagram基本显示API令牌
与Instagram Basic Display链接时,我们的应用要求user_profile
和user_media
scopes。链接时,用户可以删除user_media
范围,该范围违反了与我们的应用链接的目的。
我想验证用户已授予user_media
权限,但无法找到一种很好的方法。
facebook access access访问deken debugger 能够显示我粘贴范围的范围在IG基本令牌中。
我已经尝试使用/debug_token
来自图形API。它让我可以调试Facebook和IG图形令牌,但不是IG Basic:
GET /debug_token?input_token=<token-to-debug>&access_token=<app-access-token>
我提供的“ App-Access-token”是我的Instagram Basic Display应用程序的ID和秘密这样的组合:app-ID | app--秘密
当我这样做时,我会发现一个错误:
错误验证应用程序。由于系统错误,无法获取应用程序信息。
我唯一能想到的是尝试访问用户的IG媒体,并检测是否失败了,如果没有权限错误。如果有更好的方法,我想避免这样做:)
When linking with the Instagram Basic Display, our app asks for the user_profile
and user_media
scopes. When linking, the user can de-select the user_media
scope, which defeats the purpose of linking with our app.
I'd like to validate that the user has granted the user_media
permissions, but can't figure out a good way to do it.
The Facebook Access Token Debugger is able to display the scopes that were granted when I paste in an IG Basic token.
I've tried using the /debug_token
endpoint from the Graph API. It lets me debug Facebook and IG Graph tokens, but not IG Basic:
GET /debug_token?input_token=<token-to-debug>&access_token=<app-access-token>
The "app-access-token" I'm supplying is my Instagram Basic Display app's ID and secret combined together like this: app-id|app-secret
When I do this I get an error saying:
Error validating application. Cannot get application info due to a system error.
The only thing I can think of doing is to try accessing the user's IG media and detecting if it fails w/a permissions error. I'd like to avoid doing this if there is a better way :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我最终使用一个 api 请求来验证这一点,该请求尝试获取用户发布的最后一个媒体:
(Ruby)
此类中的
get
方法有一个错误处理程序,用于处理 HTTP 状态 >= 400 的情况在错误处理程序中,如果 HTTP 状态为403
并且错误的“代码”为190
,那么我们可以断定用户尚未授予权限。这种情况下的错误消息是:
I ended up verifying this with an api request that tries to fetch the last media posted by the user:
(Ruby)
The
get
method in this class has an error handler for when the HTTP status >= 400. In the error handler, if the HTTP status is a403
and the error has a "code" of190
then we can conclude the user has not granted the permission.The error message in this scenario is: