I copied ‘google’ and ‘accounts-google’ to my local packages directory and made a few changes to make it compatible with cisco spark as an oauth provider.
It was working great, so I thought I would share my success and publish ‘ciscospark’ and ‘accounts-ciscospark’
So I renamed all references, filenames, packages, etc and reset my meteor project.
Unlike ‘loginWithGoogle’ that is clearly published as an available function here:
https://docs.meteor.com/api/accounts.html#Meteor-loginWith<ExternalService>
I’m using a custom service, which I would assume would work the same, ie loginWithCiscoSpark.
Heres the relevant code.
ciscospark.js
Accounts.oauth.registerService(‘ciscospark’);
Meteor.loginWithCiscoSpark = function(options, callback) { … }
ciscospark_server.js
CiscoSpark = {};
OAuth.registerService(‘ciscospark’, 2, null, function(query)
ciscospark_client.js
CiscoSpark = {};
var config = ServiceConfiguration.configurations.findOne({service: ‘ciscospark’});
OAuth.launchLogin({
loginService: “ciscospark”,
loginStyle: loginStyle,
loginUrl: loginUrl,
credentialRequestCompleteCallback: credentialRequestCompleteCallback,
credentialToken: credentialToken,
popupOptions: { height: 600 }
});
accounts.js
ServiceConfiguration.configurations.update(
{ service: “ciscospark” },
{ $set: {
loginStyle: ‘popup’,
clientId: ‘redacted’,
secret: ‘redacted’
}
},
{ upsert: true }
);