简体   繁体   English

Steam OpenId realm 和 returnUrl

[英]Steam OpenId realm and returnUrl

I'm working on an application which use node-steam-openid .我正在开发一个使用node-steam-openid的应用程序。

I import it like this const SteamAuth = require("node-steam-openid");我像这样导入它const SteamAuth = require("node-steam-openid");

When i create the SteamAuth object, 3 params are require realm , returnUrl and apiKey :当我创建SteamAuth object 时,需要 3 个参数realmreturnUrlapiKey

const steam = new SteamAuth({
    realm: "https://example.net", // Site name displayed to users on logon
    returnUrl: "https://rest_site.net/test/api/auth/steam/authenticate", // Your return route
    apiKey: apiKey // Steam API key 
});

In this case returnUrl is an API call that triggers my function in the backend that actually retrieves the user data and save the steamId in database.在这种情况下, returnUrl是一个 API 调用,它在后端触发我的 function,它实际上检索用户数据并将 steamId 保存在数据库中。

The issue is that once opened the steam auth and insert the credentials, it gives me a generic error问题是,一旦打开 Steam 身份验证并插入凭据,就会出现一般性错误


The first thing that came to my mind is that returnUrl must not be an API call, so i change the SteamAuth object params:我想到的第一件事是returnUrl不能是 API 调用,所以我更改了SteamAuth object 参数:

const steam = new SteamAuth({
    realm: "https://example.net", // Site name displayed to users on logon
    returnUrl: "https://example.net/test_auth", // Your return route
    apiKey: apiKey // Steam API key
 });

With this new params, after steam authentication success, i'm being redirect (correctly) to https://example.net/test_auth有了这个新参数,在 Steam 身份验证成功后,我被重定向(正确)到https://example.net/test_auth

I wonder why I can't insert an API call as return route after steam authentication success我想知道为什么在 Steam 身份验证成功后我不能插入 API 调用作为返回路由

I think that your problem there was that your returnURL wasn't in the same realm that you specified.我认为您的问题是您的 returnURL 不在您指定的同一个 realm 中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM