meteor-accounts-vk
Login service for VKontakte accounts (https://vk.com).
Usage
- Add the package to your project using meteorite:
$ meteor add mrt:accounts-vk
-
Configure vkontakte login service. You can do mannually or using GUI.
Manually: Just add next code to your config file.
1 if (Meteor.isServer) { 2 ServiceConfiguration.configurations.remove({ 3 service: 'vk' 4 }); 5 6 ServiceConfiguration.configurations.insert({ 7 service: 'vk', 8 appId: '1234567', // Your app id 9 secret: 'someappsecret', // Your app secret 10 scope: 'email,status', // Your app scope 11 v: '5.92' // VK API version 12 }); 13 }
GUI:
-
Add
accounts-ui
package to your project:$ meteor add accounts-ui
-
Set
{{> loginButtons}}
into your template -
Go to your browser, open page with
{{> loginButtons}}
-
Click on "configure Vk login" button
-
Fill "App Id", "App Secret", "Scope" fields in popup window following by instructions
-
-
Use
Meteor.loginWithVk(options, callback)
for user authentication (you can omitoptions
argument). -
For customization of new user creation you must set 'createUser' event handler:
1 if (Meteor.isServer) { 2 Accounts.onCreateUser(function(options, user) { 3 user.custom_field = "custom value"; 4 // ... 5 return user; 6 }); 7 }
Enjoy!
If this package helped you - STAR it on github. This is not difficult for you, but important for me.
Contributors
Thanks to these people for their contributions! I appriciate it a lot!
- @mike1pol (Mikhail Poluboyarinov)
- @Neftedollar
- @illfantasy
- @Chronosms (Mikhail Smykov)
Dependencies
- accounts-base
- accounts-oauth
- accounts-ui (if you want to use GUI)