Twitter api 密钥说未知密钥

Twitter api key says unknown key

我已经从以下站点下载了源代码 http://oauth-io.github.io/oauth-js/

并按原样为 Twitter 实施。 但是当我用我的应用程序消费者密钥初始化它时 returns 未知密钥,当我提供消费者密钥表单演示源代码时,它有效,我需要什么设置。

function twitterLogin()
    {
        console.log(OAuth);
        OAuth.initialize('xxxxxx');
        OAuth.popup('twitter', function (error, success) {
            console.log('error ' + error);
            console.log('success ' + success);
        });

}

它只是说未知密钥并立即关闭弹出窗口。

谢谢

来自OAuth.io Docs

When you create an OAuth.io application in your dashboard, a pair of public key, private key is generated. You will need this pari to initialize the SDK later on.

// Initialize the SDK
OAuth.initialize('Your-public-key')

To authorize your app using OAuth.io, you just need to add a provider to your OAuth.io app, copy/paste your provider’s API Keys (usually client_id and client_secret), and specify a permission scope. Then, you can directly try a connection to the provider, by clicking on the Try auth button.

You can also use the Token API to sign up your users with their social identity. provider is the name of a provider on OAuth.io as facebook, twitter, google and 100+ others.

The provider needs to have the User API enabled to work properly (you can see it when you add a new provider in your OAuth.io Dashbaord).

这很重要。你的 Twitter API 键进入你的 OAuth.io 仪表板,你的 OAuth.io 键进入你的初始化函数。