Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error with twitter and linkedin #456

Open
sapkal-manish opened this issue Dec 26, 2013 · 0 comments
Open

Error with twitter and linkedin #456

sapkal-manish opened this issue Dec 26, 2013 · 0 comments
Labels

Comments

@sapkal-manish
Copy link

I am using everyauth to import email address in my application. previously using old version of twitter api it is working fine, but now with new version of twitter (1.1) it is giving me error 404 (page does not exists).
Same thing happen with linkedin. It is giving me error with statuscode 403 (access to connections denied). In above both cases authentication process is completed successfully. Here is my code written in node.js

TWITTER :

    everyauth.twitter
        .consumerKey(consumerKey)
        .consumerSecret(consumerSecret)
        .callbackPath('/auth/twitter/callback/')
        .findOrCreateUser(function (session, accessToken, accessTokenExtra, user) {
            var promise = this.Promise();
            promise.fulfill(user);
            return promise;
        })
        .fetchOAuthUser(function (accessToken, accessTokenSecret, params) {
            var promise = this.Promise();
            var url = this.apiHost() + '/1.1/statuses/followers.json?user_id=' + params.user_id;
            this.oauth.get(url, accessToken, accessTokenSecret, function (err, data, res) {
                if (err) {
                    err.extra = { data: data, res: res };
                    return promise.fail(err);
                }

                oauthUser.tokan = [{ 'accessToken': accessToken }, { 'accessTokenSecret': accessTokenSecret }];
                oauthUser = JSON.parse(data);
                promise.fulfill(oauthUser);
            });
            return promise;
        }).redirectPath('/callbackpath');

LINKEDIN : 
everyauth.linkedin
    .myHostname(hostname)
    .consumerKey(apiKey)
    .consumerSecret(apiSecret)        
    .callbackPath('/auth/linkedin/callback/')
    //.scope('r_emailaddress')
    .findOrCreateUser(function (session, accessToken, accessTokenExtra, user) {
        var promise = this.Promise();
        promise.fulfill(user);
        return promise;
    })
    .fetchOAuthUser(function (accessToken, accessTokenSecret, params) {
        var promise = this.Promise();
        var url = 'http://api.linkedin.com/v1/people/~/connections';
        this.oauth.get(url, accessToken, accessTokenSecret, function (err, data, res) {
            if (err) {
                err.extra = { data: data, res: res };
                return promise.fail(err);
            }
            oauthUser = JSON.parse(data);
            promise.fulfill(oauthUser);
        });
        return promise;
    }).redirectPath('/callbackpath');

Please resolve the above problem as early as possible.

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants