使用 Vue js 应用程序登录 Steam [英] Steam login with Vue js applicaiton
问题描述
我写在这里是因为我想制作一个处理反恐精英比赛的应用程序.
我想在 VueJS、nodeJS 和 mongoDB 中开发这个应用程序.有没有一种方法可以登录到 Steam 并通过 vue js 获取用户的帐户信息?我到处搜索,但找不到任何文档.我已经让它在我的 nodeJS api 上工作,但是当涉及到会话和身份验证时,它只在我的 api url 上工作,这与我的 vue js 应用程序不同.
非常感谢.
我不知道任何 Vue,但这里有一些 HTML.这实现了官方 Steam 文档中所述的登录.
<块引用>
有没有一种方法可以让我通过 vue js 登录 Steam 并获取用户的帐户信息?
- 用户将在您的网站上单击此表单中的按钮,并将重定向到 Steam 社区登录页面.
- 然后,用户可以在 Steam 社区页面上登录他们的 Steam 帐户.
- 使用
YourDomainUrlToReturnTo
,您可以指定用户通过 Steam 成功登录后返回到您网站的位置. - Steam 将在浏览器的 location 对象中提供 Steam ID一>.
- 使用该 Steam ID,您可以通过 Steam Web API 获取用户信息.立>
I'm writing in here because i want to make an application which handles counter-strike tournaments.
I want to develop this app in VueJS, nodeJS and mongoDB. Is there a way i can login to steam and fetch account information for the user via vue js? I've searched everywhere but couldnt fint any documentation for this. I've made it work on my nodeJS api but when it comes to sessions and authentication does it only work on my api url which is not the same as my vue js application.
Thanks a lot.
I don't know any Vue but here is some HTML instead. This achieves the login as outlined in the official Steam documentation.
<form action="https://steamcommunity.com/openid/login" method="post">
<input type="hidden" name="openid.identity"
value="http://specs.openid.net/auth/2.0/identifier_select" />
<input type="hidden" name="openid.claimed_id"
value="http://specs.openid.net/auth/2.0/identifier_select" />
<input type="hidden" name="openid.ns" value="http://specs.openid.net/auth/2.0" />
<input type="hidden" name="openid.mode" value="checkid_setup" />
<input type="hidden" name="openid.realm" value="https:\\yourOpenIdRealm.com" />
<input type="hidden" name="openid.return_to" value="https:\\YourDomainUrlToReturnTo.com" />
<Button type="submit">Log in through Steam</Button>
</form>
Is there a way i can login to steam and fetch account information for the user via vue js?
- The user will click the button in this form on your site and will be redireced to the Steam community login page.
- The user can then log into their Steam account on the Steam community pages.
- With
YourDomainUrlToReturnTo
you specify where the user retuns to your site after successful login via Steam. - Steam will provide the Steam ID in the browser's location object.
- With that Steam ID you can fetch user info via the Steam Web API.
这篇关于使用 Vue js 应用程序登录 Steam的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!