简体   繁体   English

instagram api-oAuth-用户获取沙箱

[英]instagram api - oAuth - users get the sandbox

I have a question, about the Instagram Api oAuth. 我有一个关于Instagram Api oAuth的问题。 create a small api, which users allow to generate a instagram api token key. 创建一个小的api,用户可以使用它生成instagram api令牌密钥。 but, my problem is, when I log in with my account, the source works. 但是,我的问题是,当我使用自己的帐户登录时,源有效。 But, when someone other with a different account want to lo in. the get this back: 但是,当其他人使用另一个帐户登录时,请找回该邮件:

{"error_message": "You are not a sandbox user of this client", "error_type": "OAuthForbiddenException", "code": 403}

I don't know, what the hell the problem is? 我不知道,到底是什么问题? maybe in the Valid redirect URIs? 也许在有效重定向URI中? I have there the same URL like website url? 我有和网站网址一样的网址吗? Do I have to submit in the end of the url? 我必须在网址末尾提交吗? something? 什么? I have read down the docu: instagram.com/ oAuth. 我已经阅读了文档:instagram.com/ oAuth。 I followed these steps: 我按照以下步骤操作:

first: 第一:

sign up to my developer account: 注册我的开发者帐户:

then register a new client: 然后注册一个新客户:

website URL: mywebsitecom/token/ 网站网址:mywebsitecom / token /

Valid redirect URIs: mywebsitecom/token/ 有效的重定向URI:mywebsitecom / token /

the app should work so: user click on the button >> then it will be forward to the oauth >> after authorize the app >> the user will get the token key on the same page or site website/token/#access_token=1920579593.4ca8793.a66f6aa9d40243afa282735f707b58b3 该应用程序应该这样工作:用户单击按钮>>,然后将其转发给oauth >>授权该应用程序之后>>用户将在同一页面或站点website/token/#access_token=1920579593.4ca8793.a66f6aa9d40243afa282735f707b58b3上获得令牌密钥。 website/token/#access_token=1920579593.4ca8793.a66f6aa9d40243afa282735f707b58b3

how can i doing that? 我该怎么做? i dont know, where the problme is.. the app is with Disable implicit OAuth: 我不知道,问题在哪里..该应用程序具有禁用隐式OAuth:

Here is my source: 这是我的资料来源:

<!doctype html>
<html class="no-js" lang="en">
    <head>

        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">

        <title>Instagram API Access Token KEY Generator – by Lucas Gatsas</title>

        <link rel="icon" type="image/png" href="images/favicon.png">

        <meta name="description" content="Quickly generate an access token for Instagram to display your photos on your website.">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <script src="assets/js/javascript.modify.js"></script>
        <link rel="stylesheet" type="text/css" href="assets/css/stylesheet.css">

        <script type="text/javascript">

          (function(){$(function(){var n,t,o,c;return c=function(){return o()?($(document.body).addClass("token-received"),t()):$(document.body).addClass("no-token"),n()},o=function(){var n;return n=window.location.hash,!!(n.length&&n.indexOf("access_token")>-1)},t=function(){var n;return n=window.location.hash.split("#access_token=")[1],$(".instagram-access-token").val(n).on("click",function(){return $(this).select()})},n=function(){return Modernizr.svg?void 0:$(".logo").attr("src",$(".logo").data("backup-png"))},c()})}).call(this);
        </script>
    </head>
    <body>

        <div class="site-header-wrapper">
            <header class="site-header" role="banner">
                <img src="assets/img/Instagram-logo.png" style=" width 200px;
                     display contents;
                     margin 0 auto;
                     text-align center;
                     display -webkit-box;">

            </header>
        </div>
        <div class="site-content-wrapper">
            <div class="site-content" role="main">
                <div class="pre-token">
                    <div class="token-button-wrapper">
                        <a href="https://www.instagram.com/oauth/authorize/?client_id=6ca879341cd14455bd12f4fb93515ed9&redirect_uri=http://lucasgatsas.ch/token/&response_type=token" class="button" title="Generate Instagram Access Token">Generate Token Key</a>
                    </div>

                    <p>You'll be brought right back here and, if all went well, your Instagram Access Token will be ready for you. Copy and paste this access token into the correct field. Remember to keep your access token private and never paste it in a location where others might can access it.</p>
                    <a href="https://twitter.com/share" class="twitter-share-button" data-url="http://lucasgatsas.ch/token" data-text="Check Out the Instagram Access Token Api Key Generator" data-size="large" data-hashtags="instagram">Tweet</a>
                    <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
                    <code>
                        https://api.instagram.com/oauth/authorize/?client_id=CLIENT-ID&redirect_uri=REDIRECT-URI&response_type=token
                    </code>
                    <h1>Docu:</h1>
                    <p><a href="https://www.instagram.com/developer/" target="_blank">Instagram Developers</a></p>
                    <p><a href="https://www.instagram.com/developer/authentication/" target="_blank">oAuth2 - Authentication</a></p>
                    <p><a href="https://www.instagram.com/developer/authentication/" target="_blank">oAuth2 - Authentication</a></p>

                    <h1>Links:</h1>
                    <p><a href="https://tools.ietf.org/html/draft-ietf-oauth-v2-12" target="_blank">oAuth V.2</a></p>
                    <div class="post-token">
                        <h2>It worked!</h2>
                        <p>Use this token in the appropriate field on your website or blog, and you should have a working Instagram widget.</p>
                        <div class="token-input-wrapper">
                            <input class="instagram-access-token" type="text" value="" size="50">
                        </div>
                        <p>Are you have any Question to the Api Token Key. Please feel free to contact me <a href="mailto:space@lucasgatsas.ch">Contact Me.</p>
                    </div>
                </div>
            </div>

            <div class="site-footer-wrapper">
                <footer class="site-footer">
                    <p>©.2017 by  <a href="http://lucasgatsas.ch">Lucas Gatsas</a></p>
                </footer>
            </div>

            <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
            <script>window.jQuery || document.write("<script src='scripts/jquery-1.11.1.min.js'><\/script>")</script>
            <script type="text/javascript">
                (function () { $(function () { var n, t, o, c; return c = function () { return o() ? ($(document.body).addClass("token-received"), t()) : $(document.body).addClass("no-token"), n() }, o = function () { var n; return n = window.location.hash, !!(n.length && n.indexOf("access_token") > -1) }, t = function () { var n; return n = window.location.hash.split("#access_token=")[1], $(".instagram-access-token").val(n).on("click", function () { return $(this).select() }) }, n = function () { return Modernizr.svg ? void 0 : $(".logo").attr("src", $(".logo").data("backup-png")) }, c() }) }).call(this);
            </script>
    </body>
</html>

Hope some one can give me tips? 希望有人可以给我提示吗?

Your client isn't accessible by every user. 并非每个用户都可以访问您的客户端。 You need to invite the user you are testing with as a "Sandbox User". 您需要邀请与您一起测试的用户作为“沙盒用户”。

Navigate to "Manage Clients" and click "Manage" for the client you wish to use. 导航到“管理客户端”,然后为要使用的客户端单击“管理”。 Choose the tab "Sandbox" and add the user you are testing with. 选择选项卡“沙箱”,然后添加要测试的用户。

As you can see your own account is added by default by Instagram. 如您所见,Instagram默认情况下会添加您自己的帐户。

Best of luck 祝你好运

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM