我有一個問題,關於Instagram Api oAuth。創建一個小api,用戶允許生成一個instagram api令牌密鑰。但是,我的問題是,當我用我的帳戶登錄時,源代碼有效。但是,當別人用不同的帳戶想要進去。回到這裏:instagram api - oAuth - 用戶得到沙箱
{"error_message": "You are not a sandbox user of this client", "error_type": "OAuthForbiddenException", "code": 403}
我不知道,到底是什麼問題是?也許在有效的重定向URI?我在那裏有相同的網址,如網址?我需要在網址的末尾提交嗎?什麼?我已經讀過文件:instagram.com/ oAuth。我按照這些步驟:
第一:
簽了我的開發者帳號:
然後註冊一個新的客戶端:
網站網址:mywebsitecom /標記/
有效重定向URI:mywebsitecom /令牌/
該應用應該如此工作:用戶點擊按鈕>>然後它會在轉發到oauth >>授權應用後>>用戶將在同一頁面或站點上獲得令牌密鑰website/token/#access_token=1920579593.4ca8793.a66f6aa9d40243afa282735f707b58b3
我該怎麼做?我不知道,這裏的problme是.. 應用程序是禁用隱含的OAuth:
這裏是我的源:
<!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:[email protected]">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>
希望有人能給我建議嗎?
非常感謝,聽起來不錯,直到現在還沒有完成項目,但我現在會嘗試。如果確實有效,回到你身邊。和平L. – user3061844