페이스 북의 액세스 토큰을 얻고 싶습니다. 페이스 북 개발자 웹 사이트에서이 코드를 얻었지만 액세스 토큰을 생성하거나 제공 할 수 없습니다. 내 웹 사이트가 아닌 간단한 텍스트 파일에서이 코드를 사용합니다.페이스 북의 JavaScript SDK
<div id="fb-root"></div>
<script>
<div class="fb-login-button" data-show-faces="true" data-width="400" data-max-rows="1"></div>
window.fbAsyncInit = function() {
FB.init({
appId : '377263832388887', // App ID
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
xfbml : true // parse XFBML
});
FB.Event.subscribe('auth.authResponseChange', function(response) {
if (response.status === 'connected') {
// the user is logged in and has authenticated your
// app, and response.authResponse supplies
// the user's ID, a valid access token, a signed
// request, and the time the access token
// and signed request each expire
var uid = response.authResponse.userID;
var accessToken = response.authResponse.accessToken;
// TODO: Handle the access token
} else if (response.status === 'not_authorized') {
// the user is logged in to Facebook,
// but has not authenticated your app
} else {
// the user isn't logged in to Facebook.
}
};
// Load the SDK Asynchronously
(function(d){
var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0];
if (d.getElementById(id)) {return;}
js = d.createElement('script'); js.id = id; js.async = true;
js.src = "//connect.facebook.net/en_US/all.js";
ref.parentNode.insertBefore(js, ref);
}(document));
});
</script>
나는 내 작업을 계속 진행할 수 있도록 액세스 토큰을 얻고 싶습니다. 고맙습니다.
실제로 사용자에게 앱 인증을 요청 하시겠습니까? 그것 없이는 액세스 토큰을 얻을 수 없습니다. –