dtbc37573 2011-10-01 11:10
浏览 209
已采纳

检索Steam帐户的OpenID数据,返回null?

I'm using Light-OpenID for PHP to authenticate and retrieve data.

For my OpenID provider URL I am using http://steamcommunity.com/openid/, as documented here-

Steam OpenID Provider Steam can act as an OpenID provider. This allows your application to authenticate a user's SteamID without requiring them to enter their Steam username or password on your site (which would be a violation of the API Terms of Use.) Just download an OpenID library for your language and platform of choice and use http://steamcommunity.com/openid as the provider. The returned Claimed ID will contain the user's 64-bit SteamID. The Claimed ID format is: http://steamcommunity.com/openid/id/

I have specified my required array of data that I am requesting as such -

$openid->required = array(
                        'namePerson',
                        'namePerson/first',
                        'namePerson/last',
                        'namePerson/friendly',
                        'contact/email',
                        'email');

I have made sure my code works, have tested it with other providers such as Google and Yahoo.

I try to login using Steam, I am authenticated, yet when I want to retrieve data about the user using $openid->getAttributes(); the array returns empty.

I have investigated more, and it appears Steam also serves data through its Web API using GetPlayerSummaries. I suppose I could use the 64BIT Steam ID from the authorization of the OpenID account to request the data, but this would require an API key, and parsing the data in PHP.

Is there a way to request this data using OpenID? Or do I have to manually parse everything through Steam's API?

  • 写回答

1条回答 默认 最新

  • douya2982 2011-10-01 11:33
    关注

    Steam can act as an OpenID provider. This allows your application to authenticate a user's SteamID without requiring them to enter their Steam username or password on your site (which would be a violation of the API Terms of Use.)

    This answers a part of your question? They use openId only for authentication - nothing more. In answer on other part i should say - yes you should obtain service key from steam and use GetPlayerSummaries method to get what you want. The parsing will be not problem because they support much formats for return (i would use JSON).

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog