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

OAuthAccessTokenException: The access_token provided is invalid #99

Open
mattfiocca opened this issue Jun 3, 2016 · 5 comments
Open

Comments

@mattfiocca
Copy link

We're seeing this in our logs all of a sudden:

OAuthAccessTokenException: The access_token provided is invalid

Here's how we're using this module:

var ig = require('instagram-node').instagram();
ig.use({
    client_id: config.instagram.client_id,
    client_secret: config.instagram.client_secret
});
ig.tag_media_recent('cats', function(err, medias, pagination, remaining, limit){
    console.log(err); // <- HERE
});

To be honest, we've been using this a while now, and I just learned that the IG API has undergone some auth changes. What are we missing here?

Thanks in advance.

@super-ienien
Copy link

super-ienien commented Jun 4, 2016

see : #98

You must revalidate your users tokens

@mattfiocca
Copy link
Author

So, the way we've been using this, we don't have users at all, and we've just been aggregating public instagrams. Is this no longer a thing?

@super-ienien
Copy link

sorry, i answered you too quickly.

Ithink the API now require user authentication for every endpoints. You can not use it without an user account anymore.

From the API documentation :

The Instagram API requires authentication - specifically requests made on behalf of a user. Authenticated requests require an access_token. These tokens are unique to a user and should be stored securely. Access tokens may expire at any time in the future.

https://www.instagram.com/developer/endpoints/tags/

@levarne
Copy link

levarne commented Aug 12, 2016

Has this issue been resolved?

@levarne
Copy link

levarne commented Aug 12, 2016

This worked for me, just add the token, or override the req with your own, instead of calling instagram.user(), make your own call. Thats I did till this gets fixed.

call('GET', '/users/' + id, {access_token:'Token'}, function(err, result, remaining, limit) {
if(err) {
return handle_error(err, cb, retry);
} else if(result && result.meta && result.meta.code === 200) {
return cb(null, result.data, remaining, limit);
} else {
return handle_error(result, cb, retry);
}
}, retry);

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

No branches or pull requests

3 participants