【问题标题】:obtaining passport windows live refresh token获取护照窗口实时刷新令牌
【发布时间】:2015-10-04 18:20:06
【问题描述】:

我正在使用 passport-windowslive 模块,我想获得一个刷新令牌,以便当我的访问令牌过期时,我可以使用 passport-oauth-refresh模块来获取一个新的,但是,我的 Passport 策略中的 refreshToken 参数不断返回 undefined 并因此在我的数据库中保存为 null。

我已经尝试像这样添加 accessType 和approvalPrompt 参数但没有成功:

app.route('/auth/windowslive').get(passport.authenticate('windowslive', {
    scope: [
        'wl.signin',
        'wl.basic',
        'wl.emails',
        'wl.contacts_emails'
    ],
    accessType: 'offline',
    approvalPrompt: 'force'
}));

任何机构之前都遇到过这个问题/知道如何获取此策略的刷新令牌?

【问题讨论】:

    标签: node.js oauth oauth-2.0 passport.js access-token


    【解决方案1】:

    您需要请求wl.offline_access 范围才能获得refresh_token

    【讨论】:

      猜你喜欢
      • 2019-05-15
      • 2019-11-17
      • 2020-12-18
      • 2017-04-09
      • 2017-09-13
      • 2018-01-03
      • 2023-01-24
      • 2012-05-04
      • 2012-06-29
      相关资源
      最近更新 更多