[英]How to get long lived access token from vkontakte?
I am using passport js for authenticating people in my node.js application. 我正在使用护照js来对我的node.js应用程序中的人进行身份验证。 In case of vkontakte I got the access token which is valid for just one day? 在vkontakte的情况下,我获得了仅一天有效的访问令牌? here is my code 这是我的代码
passport.use(new VKontakteStrategy({clientID: '******',clientSecret: '********',callbackURL: "http://example.com/signin/vkontakte/callback",profileFields: ['notify','friends','photos','notes','pages','offers','questions','wall','messages','offline']},
function (accessToken, refreshToken, profile, done) {
process.nextTick(function () {
console.log('vk profile: '+util.inspect(profile));
console.log('refresh Token: '+refreshToken);
profile.accessToken = accessToken.toString();
return done(null, profile);
});
}
)); )); ` Is there a way to increase the validity period? `有没有办法延长有效期? Help appreciated. 帮助表示赞赏。 Thanks in advance. 提前致谢。
在令牌请求中设置scope = offline
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.