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

scopes do not work #20

Open
jtkeyva opened this issue Nov 17, 2016 · 0 comments
Open

scopes do not work #20

jtkeyva opened this issue Nov 17, 2016 · 0 comments

Comments

@jtkeyva
Copy link

jtkeyva commented Nov 17, 2016

I get this error whenever I try to use a scope:
{"code": 400, "error_type": "OAuthException", "error_message": "Invalid scope field(s): p,u,b,l,i,c,_,c,o,n,t,e,n,t"}

Here's what my code looks like:
ServiceConfiguration.configurations.insert({
service: 'instagram',
scope: "public_content",
clientId: 'CLIENTID_HERE',
secret: 'SECRET_HERE'
});

Authentication works if I remove the scopes line, but then I don't have the scope. I am baffled, please help!
Thanks

FIXED
Here is the code I ended up using in server/accounts.js and it works now!

if (Meteor.isClient) {
Template.hello.events({
'click button': function () {
// increment the counter when button is clicked
Session.set("counter", Session.get("counter") + 1);
Meteor.loginWithInstagram({
loginStyle: 'popup',
requestPermissions: ['basic','public_content']

    //loginStyle: 'redirect'  you can use redirect for mobile web app
  }, function () {
    console.log('in call back', arguments);
  });
}

});
}

if (Meteor.isServer) {
Meteor.startup(function () {
// code to run on server at startup
Accounts.loginServiceConfiguration.remove({
service: 'instagram'
});

Accounts.loginServiceConfiguration.insert({
  service: 'instagram',
  clientId: 'CLIENTID',
  secret: 'SECRET',
  scope: ['basic','public_content']
});

});
}

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

1 participant