如何从vkontakte获得长寿命访问令牌



我正在使用passport-js对node.js应用程序中的人员进行身份验证。在vkontakte的情况下,我得到了只有效一天的访问令牌?这是我的代码

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);
    });
}

));`有没有办法延长有效期?感谢您的帮助。提前谢谢。

在令牌请求中设置scope=offline

最新更新