I fix error, when you have no token and can't work with two step auth.
Node js module to easily get vk token from login and password.
var vktoken = require('vk-token-FIXED');
vktoken.getAccessToken(username, password, function(error, token){
console.log(token);
});
vktoken.twoStep(response, code, function(token, error){
console.log(token);
})
getAccessToken(username, password, callback, appid, scopes)
- username - e-mail or phone number registred on vk.com
- password - user password
- callback - callback function.
The callback argument gets 3 arguments:
- error - request module errors if any. null otherwise
- token - vk access token. null if any errors
- response - request module last response.
- response in two step auth - url with autocheck.
- appid - application id to use. If nothing is specified, android official app id is used. You can pass 'android', 'ios' or 'wp' as argument for specific platform.
- scopes - comma-separated or array scopes list. Possible scopes are notify, friends, photos, audio, video, docs, notes, pages, status, offers, questions, wall, groups, messages, notifications, stats, ads, offline. Default are all of them.
Original repo: https://github.com/TrueLecter/vk-token