NodeJS Passport-Steam,OpenID无效的返回URL

时间:2016-06-11 14:13:12

标签: node.js openid steam steam-web-api

我目前正在使用多个OAuth和OpenID服务构建NodeJS后端。我有Passport-Steam的问题,我无法找到解决方案。

这是我的策略:

var STEAM_KEY = process.env.STEAM_KEY;

// Use the SteamStrategy within Passport.
passport.use(new SteamStrategy({
    apiKey: STEAM_KEY,
    realm: 'https://player.abc/',
    returnURL: "https://player.abc/api/service/callback/steam"
}, function(identifier, profile, done) {
    done(null, profile);
}));

查看返回URL及其参数时,服务器在" return_to"中收到正确的URL。调用参数和正确的端点。但我收到以下错误:

GET /api/service/connect/steam 302 1500.518 ms - 0
{ [InternalOpenIDError: Failed to verify assertion]
  name: 'InternalOpenIDError',
  message: 'Failed to verify assertion',
  openidError: { message: 'Invalid return URL' } 
}

我尝试过以下方法:

  1. 更改为HTTP
  2. 更改API密钥(当前域设置为" player.abc"在Steam Dev中)
  3. 完全更改返回网址
  4. 重新安装护照 - 蒸汽
  5. 非常感谢任何帮助

1 个答案:

答案 0 :(得分:0)

您忘了添加

profile.identifier = identifier;



passport.use(new SteamStrategy({
    apiKey: STEAM_KEY,
    realm: 'https://player.abc/',
    returnURL: "https://player.abc/api/service/callback/steam"
}, function(identifier, profile, done) {
    profile.identifier = identifier;
    done(null, profile);
}));