Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ruby-on-rails-3/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 我怎么能不使用JS客户端每次对StackExchange API调用进行身份验证?_Javascript_Ruby On Rails 3_Stackexchange Api - Fatal编程技术网

Javascript 我怎么能不使用JS客户端每次对StackExchange API调用进行身份验证?

Javascript 我怎么能不使用JS客户端每次对StackExchange API调用进行身份验证?,javascript,ruby-on-rails-3,stackexchange-api,Javascript,Ruby On Rails 3,Stackexchange Api,我正在使用来自的代码从StackOverflow获取用户信息 // For simplicity, we're using jQuery for some things // However, the library has no jQuery dependency $(function(){ // Initialize library SE.init({ // Parameters obtained by registering an app, these are specifi

我正在使用来自的代码从StackOverflow获取用户信息

// For simplicity, we're using jQuery for some things
//   However, the library has no jQuery dependency
$(function(){
// Initialize library
SE.init({ 
    // Parameters obtained by registering an app, these are specific to the SE
    //   documentation site
    clientId: 1, 
    key: 'U4DMV*8nvpm3EOpvf69Rxw((', 
    // Used for cross domain communication, it will be validated
    channelUrl: 'https://api.stackexchange.com/docs/proxy',
    // Called when all initialization is finished
    complete: function(data) { 
        $('#login-button')
            .removeAttr('disabled')
            .text('Run Example With Version '+data.version); 
    }
});

// Attach click handler to login button
$('#login-button').click(function() {

    // Make the authentication call, note that being in an onclick handler
    //   is important; most browsers will hide windows opened without a
    //   'click blessing'
    SE.authenticate({
        success: function(data) { 
            alert(
                'User Authorized with account id = ' + 
                data.networkUsers[0].account_id + ', got access token = ' + 
                data.accessToken
            ); 
        },
        error: function(data) { 
            alert('An error occurred:\n' + data.errorName + '\n' + data.errorMessage); 
        },
        networkUsers: true
    });
});
});
这段代码工作得很好,但我注意到,每次它触发并给出响应访问权时,都会更改令牌。如何使用访问令牌获取用户信息。此外,这是返回用户的数据与所有的网站,他是一部分。我怎样才能将其限制为堆栈溢出。我找不到这方面的适当文件


有人能告诉我从StackExchange API进行API调用的JS方法吗?

你得到答案了吗,将其限制为stackoverflow?没有,我得到了所有数据,然后过滤掉了所有数据。