我目前正在使用多个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' }
}
我尝试过以下方法:
非常感谢任何帮助
答案 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);
}));