使用 Vue js 应用程序登录 Steam [英] Steam login with Vue js applicaiton

查看:135
本文介绍了使用 Vue js 应用程序登录 Steam的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我写在这里是因为我想制作一个处理反恐精英比赛的应用程序.

我想在 VueJS、nodeJS 和 mongoDB 中开发这个应用程序.有没有一种方法可以登录到 Steam 并通过 vue js 获取用户的帐户信息?我到处搜索,但找不到任何文档.我已经让它在我的 nodeJS api 上工作,但是当涉及到会话和身份验证时,它只在我的 api url 上工作,这与我的 vue js 应用程序不同.

非常感谢.

解决方案

我不知道任何 Vue,但这里有一些 HTML.这实现了官方 Steam 文档中所述的登录.

 
<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">通过 Steam 登录</Button></表单>

<块引用>

有没有一种方法可以让我通过 vue js 登录 Steam 并获取用户的帐户信息?

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆