Skip to content

lyslim/accounts-douban

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Meteor OAuth2 login service with Douban

Usage:

  1. Install Meteor.

  2. meteor add service-configuration

  3. Apply for douban API key. For local test, please maintain the following callback path:

      http://127.0.0.1:3000/_oauth/douban
    
  4. 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 
          }
        }
      );
  5. meteor add theycallmek:accounts-douban, this will essentially install both accounts-douban and douban packages.

  6. Play with function loginWithDouban in client code, e.g.

      Meteor.loginWithDouban(/*options*/, /*callback function*/); 

Enjoy!

Reference:

  1. Douban OAuth2 doc.
  2. Meteor loginWith<ExternalService>.

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.

About

Meteor oauth2 login with douban

Resources

Stars

Watchers

Forks

Packages

No packages published