Meteor OAuth 2.0 login service for the largest social network site in China - Tencent QQ
- 准备工作:您必须到QQ互联网站注册一个"网站/应用",获取应用ID和密钥
- 在当前应用中加入本认证包
mrt add accounts-qq
- 在开发环境下,为了使腾讯的OAuth回调能真正成功,您还需要将您的应用运行在虚拟环境下:
1.
export ROOT_URL=http://your.com
2.sudo -E mrt -p 80
- 在开发和生产环境下,首次使用均需要配置OAuth服务让accounts能够正确应用。 `Meteor.call('configureLoginService', {service: 'qq', clientId:'clientId', secret: 'secret'})
- 在您的代码中调用
Meteor.loginWithQq(callback);
触发登录向导。
- You must register an ID/secret for your app/site in QQ互联网站
- Add this package into your app:
mrt add accounts-qq
- To make it work in your development environment, you would need below configuration to work with Tencent Callback:
1.
export ROOT_URL=http://your.com
2.sudo -E mrt -p 80
- In both development and deployment environment, you must first time initialize the OAuth configuration: `Meteor.call('configureLoginService', {service: 'qq', clientId:'clientId', secret: 'secret'})
- In your codes,
Meteor.loginWithQq(callback);
would trigger the login process