Usage:
-
Install Meteor.
-
meteor add service-configuration
-
Apply for douban API key. For local test, please maintain the following callback path:
http://127.0.0.1:3000/_oauth/douban
-
Provide douban api key, secret and configuratons on server code, e.g.
ServiceConfiguration.configurations.remove({service: 'douban'}); ServiceConfiguration.configurations.upsert( {service: 'douban'}, { $set: { clientId: DOUBAN_API_KEY, secret: DOUBAN_SECRET, loginStyle: 'redirect', replaceLocalhost: true } } );
-
meteor add theycallmek:accounts-douban
, this will essentially install bothaccounts-douban
anddouban
packages. -
Play with function
loginWithDouban
in client code, e.g.Meteor.loginWithDouban(/*options*/, /*callback function*/);
Enjoy!
Reference:
Note:
Current design follows other Meteor oauth services, which is highly coupled with Meteor package oauth and oauth2.
TO-DO:
Different client(other than desktop) implementations.