Skip to content

scopes do not workΒ #20

@jtkeyva

Description

@jtkeyva

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']
});

});
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions