使用 Steam OpenID 的用户数据库
我正在尝试使用 steam openid 创建一个用户管理系统,但我不确定该表应该是什么样子。我习惯于使用包含常用用户 ID、用户名和密码的基本用户表。然后使用 cookie 确认用户是否已登录。不过,我不完全确定如何使用 steamopenID 来执行此操作。
我已经完成了登录和验证,但尚未找到一个可用的数据库。成功登录后,它会返回用户 SteamID。我可以用它做什么来创建一个安全的用户系统?
我正在考虑将用户重定向到一个新页面,如果 steamid 本身不存在,他们可以在其中注册用户名,但是如何验证用户是否已登录(而不是仅使用 steamid)?
I'm trying to create a user management system using steam openid, but I'm not sure what the table should look like. I'm used to having the basic user table containing the usual userid, username and password. Then using cookies confirming if the user is logged in. I'm not entirely sure on how to do this using steamopenID though.
I've completed the login and verification but have not yet figured out to have a working database with it. After successful login it returns the Users SteamID. What can I do with this to create a safe user system?
I was thinking of redirecting the user to a new page where they can register a username if the steamid itself doesnt exist, but how do I verify if a user is logged in our not using only the steamid?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
本质上,它就像任何其他登录系统一样。
你只是不负责登录的事情。但是,是的,正如你所说。验证 ID 后,检查该 ID 是否存在于您自己的用户数据库中,如果不存在,请使用该 ID 并将其重定向到“创建配置文件”登录。
Essentially, it is like any other login system.
You're just not responsible for the login stuff. But yes, just as you say. When you have verified the ID, check if the ID exists in your own users database, and if it doesn't, work with that and redirect them to a "Create Profile" login.
您有两个身份验证提供商,一个来自您自己的站点,另一个来自 steam。对于您接受 openid 身份验证的帐户,您需要将其 openid 身份验证存储在它们旁边,因此当有人通过 openid 提供商登录您的网站时,您会发现这是您网站的哪个实际用户。
您的会话始终连接到您网站的用户 ID:
You have two authentication providers, one from your own site or alternatively, one from steam. For the accounts you accept openid auths, you need to store their openid authentifications next to them, so when somebody logs into your site via an openid provider you find out which actual user of your site this is.
You session always is connected to your site's user-id: